Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5e22e69d

Von Tamino Steinert vor 10 Monaten hinzugefügt

  • ID 5e22e69d1e1e973b8276d3f9a2c2b771e29676e6
  • Vorgänger 50a442f4
  • Nachfolger 45c6514a

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