Make the Shelf set and update the menuTitle, too.

This commit is contained in:
Colin Kuskie 2009-03-17 03:16:52 +00:00
parent 69768606eb
commit f621c1c0eb
3 changed files with 16 additions and 6 deletions

View file

@ -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

View file

@ -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;

View file

@ -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');