diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 0b2f474d0..08c875794 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -17,6 +17,7 @@ - fixed: Upgrade 7.5.10-7.5.11 upgrades transaction payment gateway info. - fixed: Form CheckList select all button now functions properly - fixed: Gallery slideshow JS now has better control over the buttons + - fixed: The bug enigmatically named "product". 7.5.19 - fixed: paginator doesn't show correct number of page links with a limit applied diff --git a/docs/upgrades/upgrade_7.4.40-7.5.16.pl b/docs/upgrades/upgrade_7.4.40-7.5.16.pl index eb0338851..ae389aefe 100644 --- a/docs/upgrades/upgrade_7.4.40-7.5.16.pl +++ b/docs/upgrades/upgrade_7.4.40-7.5.16.pl @@ -32,6 +32,7 @@ use WebGUI::Utility; use WebGUI::Pluggable; use File::Path; use JSON; +use Data::Dumper; #Don't ask my why, but there's an exposed call to this on line 2871 my $toVersion = "7.5.16"; # make this match what version you're going to my $quiet; # this line required @@ -1206,6 +1207,7 @@ sub migrateOldProduct { $session->db->write('alter table Product add column relatedJSON mediumtext'); $session->db->write('alter table Product add column specificationJSON mediumtext'); $session->db->write('alter table Product add column variantsJSON mediumtext'); + $session->db->write('alter table Product add column isShippingRequired INT(11)'); ##Build a variant for each Product. my $productQuery = $session->db->read(<db->write(q!update asset set className='WebGUI::Asset::Sku::Product' where className='WebGUI::Asset::Wobject::Product'!); ## Add variants collateral column to Sku/Product - $session->db->write('alter table Product add column thankYouMessage mediumtext'); - $session->db->write('alter table Product add column accessoryJSON mediumtext'); - $session->db->write('alter table Product add column benefitJSON mediumtext'); - $session->db->write('alter table Product add column featureJSON mediumtext'); - $session->db->write('alter table Product add column relatedJSON mediumtext'); - $session->db->write('alter table Product add column specificationJSON mediumtext'); - $session->db->write('alter table Product add column variantsJSON mediumtext'); + $session->db->write('alter table Product add column thankYouMessage mediumtext'); + $session->db->write('alter table Product add column accessoryJSON mediumtext'); + $session->db->write('alter table Product add column benefitJSON mediumtext'); + $session->db->write('alter table Product add column featureJSON mediumtext'); + $session->db->write('alter table Product add column relatedJSON mediumtext'); + $session->db->write('alter table Product add column specificationJSON mediumtext'); + $session->db->write('alter table Product add column variantsJSON mediumtext'); + $session->db->write('alter table Product add column isShippingRequired INT(11)'); + ##Build a variant for each Product. my $productQuery = $session->db->read(<db->read('describe Product isShippingRequired'); + if (! defined $sth->hashRef) { + $session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)"); + } + print "Done!\n" unless $quiet; +} + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/docs/upgrades/upgrade_7.5.13-7.5.14.pl b/docs/upgrades/upgrade_7.5.13-7.5.14.pl index 82779d87f..17fb7dd6b 100644 --- a/docs/upgrades/upgrade_7.5.13-7.5.14.pl +++ b/docs/upgrades/upgrade_7.5.13-7.5.14.pl @@ -31,6 +31,7 @@ my $session = start(); # this line required # upgrade functions go here deleteBadReceiptEmailTemplate($session); unlockShelfAssets($session); +maybeAddProductShippingColumn( $session ); finish($session); # this line required @@ -71,6 +72,19 @@ sub deleteBadReceiptEmailTemplate { print "DONE!\n" unless $quiet; } +#---------------------------------------------------------------------------- +sub maybeAddProductShippingColumn { + my $session = shift; + print "\tAdd the isShippingColumn to the Product table, if needed... " unless $quiet; + + my $sth = $session->db->read('describe Product isShippingRequired'); + if (! defined $sth->hashRef) { + $session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)"); + } + print "Done!\n" unless $quiet; +} + + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/docs/upgrades/upgrade_7.5.14-7.5.15.pl b/docs/upgrades/upgrade_7.5.14-7.5.15.pl index 6e36dc792..79964312a 100644 --- a/docs/upgrades/upgrade_7.5.14-7.5.15.pl +++ b/docs/upgrades/upgrade_7.5.14-7.5.15.pl @@ -30,6 +30,7 @@ my $session = start(); # this line required removeOldGalleryImport($session); addMissingWorkflowActivities($session); +maybeAddProductShippingColumn( $session ); finish($session); # this line required @@ -54,6 +55,18 @@ sub removeOldGalleryImport { print "DONE!\n" unless $quiet; } +#---------------------------------------------------------------------------- +sub maybeAddProductShippingColumn { + my $session = shift; + print "\tAdd the isShippingColumn to the Product table, if needed... " unless $quiet; + + my $sth = $session->db->read('describe Product isShippingRequired'); + if (! defined $sth->hashRef) { + $session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)"); + } + print "Done!\n" unless $quiet; +} + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/docs/upgrades/upgrade_7.5.15-7.5.16.pl b/docs/upgrades/upgrade_7.5.15-7.5.16.pl index 2b6f842b2..fd2bc6f88 100644 --- a/docs/upgrades/upgrade_7.5.15-7.5.16.pl +++ b/docs/upgrades/upgrade_7.5.15-7.5.16.pl @@ -30,6 +30,7 @@ my $session = start(); # this line required addIndexToInbox($session); fixEventSequenceNumbers($session); +maybeAddProductShippingColumn( $session ); finish($session); # this line required @@ -51,6 +52,18 @@ sub fixEventSequenceNumbers { print "Done.\n" unless $quiet; } +#---------------------------------------------------------------------------- +sub maybeAddProductShippingColumn { + my $session = shift; + print "\tAdd the isShippingColumn to the Product table, if needed... " unless $quiet; + + my $sth = $session->db->read('describe Product isShippingRequired'); + if (! defined $sth->hashRef) { + $session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)"); + } + print "Done!\n" unless $quiet; +} + #---------------------------------------------------------------------------- # Describe what our function does diff --git a/docs/upgrades/upgrade_7.5.16-7.5.17.pl b/docs/upgrades/upgrade_7.5.16-7.5.17.pl index 5d219a0d3..65d403a82 100644 --- a/docs/upgrades/upgrade_7.5.16-7.5.17.pl +++ b/docs/upgrades/upgrade_7.5.16-7.5.17.pl @@ -28,6 +28,7 @@ my $quiet; # this line required my $session = start(); # this line required moveProductImportToShelf($session); +maybeAddProductShippingColumn( $session ); finish($session); # this line required @@ -40,6 +41,18 @@ sub moveProductImportToShelf { print "DONE!\n" unless $quiet; } +#---------------------------------------------------------------------------- +sub maybeAddProductShippingColumn { + my $session = shift; + print "\tAdd the isShippingColumn to the Product table, if needed... " unless $quiet; + + my $sth = $session->db->read('describe Product isShippingRequired'); + if (! defined $sth->hashRef) { + $session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)"); + } + print "Done!\n" unless $quiet; +} + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/docs/upgrades/upgrade_7.5.17-7.5.18.pl b/docs/upgrades/upgrade_7.5.17-7.5.18.pl index 0acaffda0..542fad5a6 100644 --- a/docs/upgrades/upgrade_7.5.17-7.5.18.pl +++ b/docs/upgrades/upgrade_7.5.17-7.5.18.pl @@ -31,6 +31,7 @@ my $session = start(); # this line required # upgrade functions go here nukeAnEmptyTemplate($session); +maybeAddProductShippingColumn( $session ); finish($session); # this line required @@ -47,6 +48,19 @@ sub nukeAnEmptyTemplate { print "DONE!\n" unless $quiet; } +#---------------------------------------------------------------------------- +sub maybeAddProductShippingColumn { + my $session = shift; + print "\tAdd the isShippingColumn to the Product table, if needed... " unless $quiet; + + my $sth = $session->db->read('describe Product isShippingRequired'); + if (! defined $sth->hashRef) { + $session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)"); + } + print "Done!\n" unless $quiet; +} + + #---------------------------------------------------------------------------- # Describe what our function does #sub exampleFunction { diff --git a/docs/upgrades/upgrade_7.5.18-7.5.19.pl b/docs/upgrades/upgrade_7.5.18-7.5.19.pl index 8faeac07d..d0f89fe03 100644 --- a/docs/upgrades/upgrade_7.5.18-7.5.19.pl +++ b/docs/upgrades/upgrade_7.5.18-7.5.19.pl @@ -36,6 +36,7 @@ addProductShipping( $session ); addGalleryImageDensity( $session ); updatePaymentDrivers( $session ); extendVendors($session); +maybeAddProductShippingColumn( $session ); finish($session); # this line required @@ -141,6 +142,19 @@ sub addNewInboxIndexes { print "\n\t\tDONE!\n" unless $quiet; } +#---------------------------------------------------------------------------- +sub maybeAddProductShippingColumn { + my $session = shift; + print "\tAdd the isShippingColumn to the Product table, if needed... " unless $quiet; + + my $sth = $session->db->read('describe Product isShippingRequired'); + if (! defined $sth->hashRef) { + $session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)"); + } + print "Done!\n" unless $quiet; +} + + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- #---------------------------------------------------------------------------- diff --git a/docs/upgrades/upgrade_7.5.19-7.5.20.pl b/docs/upgrades/upgrade_7.5.19-7.5.20.pl index 54696748f..e25e7f0bf 100644 --- a/docs/upgrades/upgrade_7.5.19-7.5.20.pl +++ b/docs/upgrades/upgrade_7.5.19-7.5.20.pl @@ -29,6 +29,7 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here +maybeAddProductShippingColumn( $session ); addThingyFieldsSizeColumn( $session ); finish($session); # this line required @@ -43,6 +44,18 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} +#---------------------------------------------------------------------------- +sub maybeAddProductShippingColumn { + my $session = shift; + print "\tAdd the isShippingColumn to the Product table, if needed... " unless $quiet; + + my $sth = $session->db->read('describe Product isShippingRequired'); + if (! defined $sth->hashRef) { + $session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)"); + } + print "Done!\n" unless $quiet; +} + #---------------------------------------------------------------------------- # Add Thingy_fields size column sub addThingyFieldsSizeColumn {