Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1ddcd7f5

Von Tamino Steinert vor 5 Tagen hinzugefügt

  • ID 1ddcd7f591a061958cd9b2964da99b186cad0308
  • Vorgänger e01884e2

Varianten: Beim Speichern Eigenschaften gegen Ausprägung prüfen

Unterschiede anzeigen:

SL/DB/Part.pm
159 159
sub _before_check_variant_property_values {
160 160
  my ($self) = @_;
161 161
  if ($self->is_variant) {
162
    my @property_value_ids = sort map {$_->id} $self->variant_property_values;
163 162
    my $parent_variant = $self->parent_variant;
163

  
164
    my @variant_property_ids = sort map {$_->id} $self->variant_property_values;
165
    my @parent_variant_property_ids = sort map {$_->id} @{$parent_variant->variant_properties};
166
    if ("@variant_property_ids" ne "@parent_variant_property_ids") {
167
      die t8("Given variant_property_values doesn't match the variant_properties of parent_variant part.");
168
    }
169

  
170
    my @property_value_ids = sort map {$_->id} $self->variant_property_values;
164 171
    my $other_variants = $parent_variant->variants;
165 172
    foreach my $variant (@$other_variants) {
166 173
      next if $variant->id == $self->id;

Auch abrufbar als: Unified diff