diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 5aa123840..2cf40d9a9 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -15,7 +15,9 @@ - fixed #9943: Upgrade script fails with Payment Gateways - fixed #9948: Data form cannot be deleted. - fixed #9950: Wrong var in help for thread + - fixed #9956: Product Import - added Survey now has a loading mask on Survey edit ajax calls. + 7.6.14 - fixed: IE6 shows Admin Bar over Asset Manager - fixed #9808: Search i18n diff --git a/lib/WebGUI/Asset/Wobject/Shelf.pm b/lib/WebGUI/Asset/Wobject/Shelf.pm index f00b00954..d3368e970 100644 --- a/lib/WebGUI/Asset/Wobject/Shelf.pm +++ b/lib/WebGUI/Asset/Wobject/Shelf.pm @@ -210,7 +210,11 @@ sub importProducts { } if ($productRow{title} ne $product->getTitle) { - $product->update({ title => $product->fixTitle($productRow{title}) }); + my $newTitle = $product->fixTitle($productRow{title}); + $product->update({ + title => $newTitle, + menuTitle => $newTitle, + }); } my $collaterals = $product->getAllCollateral('variantsJSON'); @@ -230,10 +234,12 @@ sub importProducts { ##Insert a new product; $session->log->warn("Making a new product: $productRow{sku}\n"); my $newProduct = $node->addChild({className => 'WebGUI::Asset::Sku::Product'}); + my $newTitle = $newProduct->fixTitle($productRow{title}); $newProduct->update({ - title => $newProduct->fixTitle($productRow{title}), - url => $newProduct->fixUrl($productRow{title}), - sku => $productRow{mastersku}, + title => $newTitle, + menuTitle => $newTitle, + url => $newProduct->fixUrl($productRow{title}), + sku => $productRow{mastersku}, }); $newProduct->setCollateral('variantsJSON', 'variantId', 'new', \%productCollateral); $newProduct->commit; diff --git a/t/Asset/Wobject/Shelf.t b/t/Asset/Wobject/Shelf.t index ec4d0df4e..4ed68af15 100644 --- a/t/Asset/Wobject/Shelf.t +++ b/t/Asset/Wobject/Shelf.t @@ -33,7 +33,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -my $tests = 53; +my $tests = 55; plan tests => 1 + $tests; #---------------------------------------------------------------------------- @@ -149,6 +149,7 @@ SKIP: { isa_ok($soda, 'WebGUI::Asset::Sku::Product'); is($soda->getTitle(), 'Sweet Soda-bottled in Oregon', 'Title set correctly for soda'); is($soda->get('url'), 'sweet-soda-bottled-in-oregon', 'URL for new product from the title'); + is($soda->get('menuTitle'), $soda->getTitle, 'menuTitle is the same as title'); my $sodaCollateral = $soda->getAllCollateral('variantsJSON'); cmp_deeply( $sodaCollateral, @@ -317,7 +318,8 @@ SKIP: { is($count, 3, 'still have 3 products, nothing new added'); $soda = WebGUI::Asset::Sku->newBySku($session, 'soda'); - is($soda->getTitle(), 'Sweet Soda-totally organic', 'Title updated correctly for soda'); + is($soda->getTitle(), 'Sweet Soda-totally organic', 'Title updated correctly for soda'); + is($soda->get('menuTitle'), 'Sweet Soda-totally organic', 'menuTitle updated correctly for soda'); is($soda->get('url'), 'sweet-soda-bottled-in-oregon', 'URL for updated product from the original title, not the updated title'); $shirt = WebGUI::Asset::Sku->newBySku($session, 't-shirt'); $shirtCollateral = $shirt->getAllCollateral('variantsJSON');