Make the Product Sku copy the storage locations when a new revision is added.
This commit is contained in:
parent
1c40934876
commit
e335276cfa
3 changed files with 14 additions and 2 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
- fixed #10645: Asset History: search results not sorted as expected
|
- fixed #10645: Asset History: search results not sorted as expected
|
||||||
- fixed #10648: Story Topic: Photos don't display
|
- fixed #10648: Story Topic: Photos don't display
|
||||||
- fixed #10649: Story Manager Keywords not working correctly
|
- fixed #10649: Story Manager Keywords not working correctly
|
||||||
|
- fixed #10643: Products: Pictures gone
|
||||||
|
|
||||||
7.7.14
|
7.7.14
|
||||||
- fixed #10606: shelf selector
|
- fixed #10606: shelf selector
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ sub addRevision {
|
||||||
my $newSelf = $self->SUPER::addRevision(@_);
|
my $newSelf = $self->SUPER::addRevision(@_);
|
||||||
if ($newSelf->getRevisionCount > 1) {
|
if ($newSelf->getRevisionCount > 1) {
|
||||||
foreach my $field (qw(image1 image2 image3 brochure manual warranty)) {
|
foreach my $field (qw(image1 image2 image3 brochure manual warranty)) {
|
||||||
if ($self->get($field) && $self->get($field) ne $newSelf->get($field)) {
|
if ($self->get($field)) {
|
||||||
my $newStorage = WebGUI::Storage->get($self->session,$self->get($field))->copy;
|
my $newStorage = WebGUI::Storage->get($self->session,$self->get($field))->copy;
|
||||||
$newSelf->update({$field=>$newStorage->getId});
|
$newSelf->update({$field=>$newStorage->getId});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,6 @@ $imagedProduct->applyOptions($imagedProduct->getCollateral('variantsJSON', 'vari
|
||||||
is($imagedProduct->getConfiguredTitle, 'Bible - English', 'getConfiguredTitle is overridden and concatenates the Product Title and the variant shortdesc');
|
is($imagedProduct->getConfiguredTitle, 'Bible - English', 'getConfiguredTitle is overridden and concatenates the Product Title and the variant shortdesc');
|
||||||
|
|
||||||
my $addToCartForm = $imagedProduct->getAddToCartForm();
|
my $addToCartForm = $imagedProduct->getAddToCartForm();
|
||||||
diag $addToCartForm;
|
|
||||||
my @forms = HTML::Form->parse($addToCartForm, 'http://www.webgui.org');
|
my @forms = HTML::Form->parse($addToCartForm, 'http://www.webgui.org');
|
||||||
is(scalar @forms, 1, 'getAddToCartForm: returns only 1 form');
|
is(scalar @forms, 1, 'getAddToCartForm: returns only 1 form');
|
||||||
my $form_variants = $forms[0]->find_input('vid');
|
my $form_variants = $forms[0]->find_input('vid');
|
||||||
|
|
@ -109,3 +108,15 @@ cmp_deeply(
|
||||||
[ $form_variants->possible_values ],
|
[ $form_variants->possible_values ],
|
||||||
'... form only has 1 variant, since the other one has 0 quantity'
|
'... form only has 1 variant, since the other one has 0 quantity'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
####################################################
|
||||||
|
#
|
||||||
|
# addRevision
|
||||||
|
#
|
||||||
|
####################################################
|
||||||
|
|
||||||
|
sleep 2;
|
||||||
|
my $newImagedProduct = $imagedProduct->addRevision({title => 'Bible and hammer'});
|
||||||
|
|
||||||
|
like($newImagedProduct->get('image1'), $session->id->getValidator, 'addRevision: new product rev got an image1 storage location');
|
||||||
|
isnt($newImagedProduct->get('image1'), $imagedProduct->get('image1'), '... and it is not the same as the old one');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue