Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f7542f49

Von Tamino Steinert vor 6 Tagen hinzugefügt

  • ID f7542f49a3055032847f62f2bd1d0ee283ec3964
  • Vorgänger d34e0298
  • Nachfolger 53fd3d37

Varianten: S:D:Part: Validierungen angepasst

Unterschiede anzeigen:

SL/DB/Part.pm
161 161
    foreach my $variant (@$other_variants) {
162 162
      next if $variant->id == $self->id;
163 163
      my @other_property_value_ids = sort map {$_->id} $variant->variant_property_values;
164
      if (@other_property_value_ids == @property_value_ids
165
        && not any {$_} pairwise {$a != $b} @other_property_value_ids, @property_value_ids
166
      ) {
167
        die t8("There is already a variant with the property values: "),
164
      if ("@other_property_value_ids" eq "@property_value_ids") {
165
        die t8("There is already a variant of '#1' with the property values: ", $parent_variant->displayable_name),
168 166
          join(' ,', map {$_->displayable_name} $self->variant_property_values);
169 167
      }
170 168
    }
......
543 541

  
544 542
  my @selected_variant_property_ids = sort map {$_->variant_property_id} @$variant_property_values;
545 543
  my @variant_property_ids = sort map {$_->id} @{$self->variant_properties};
546
  if (@variant_property_ids != @selected_variant_property_ids) {
547
    die "Given variant_property_values dosn't match the variant_properties of parent_variant part";
544
  if ("@variant_property_ids" ne "@selected_variant_property_ids") {
545
    die "Given variant_property_values doesn't match the variant_properties of parent_variant part: " . $self->displayable_name;
548 546
  }
549 547

  
550 548
  my $new_variant = $self->clone_and_reset;

Auch abrufbar als: Unified diff