diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 1ba7ca548..24b6c0d2d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.7.19 + - fixed #10825: Text and MediumText fields should be LongText - fixed #10808: Ask user about using rich edit option causes error in IE6 - fixed #10822: spectre pid sucks - fixed #10817: Datatable not internationalized diff --git a/docs/upgrades/upgrade_7.7.18-7.7.19.pl b/docs/upgrades/upgrade_7.7.18-7.7.19.pl index 027a335c0..9ebee09fb 100644 --- a/docs/upgrades/upgrade_7.7.18-7.7.19.pl +++ b/docs/upgrades/upgrade_7.7.18-7.7.19.pl @@ -32,9 +32,9 @@ my $session = start(); # this line required # upgrade functions go here addInboxSmsNotificationTemplateIdSetting($session); +upgradeJSONDatabaseFields($session); finish($session); # this line required - #---------------------------------------------------------------------------- # Describe what our function does #sub exampleFunction { @@ -53,6 +53,45 @@ sub addInboxSmsNotificationTemplateIdSetting { print "DONE!\n" unless $quiet; } +sub upgradeJSONDatabaseFields { + my $session = shift; + print "\tUpgrading all fields which use JSON to LONGTEXT... " unless $quiet; + print "\n\t\tUpgrading Sku fields... " unless $quiet; + $session->db->write(q|ALTER TABLE sku MODIFY taxConfiguration LONGTEXT|); + print "\n\t\tUpgrading Product fields... " unless $quiet; + $session->db->write(q|ALTER TABLE Product MODIFY variantsJSON LONGTEXT|); + $session->db->write(q|ALTER TABLE Product MODIFY accessoryJSON LONGTEXT|); + $session->db->write(q|ALTER TABLE Product MODIFY relatedJSON LONGTEXT|); + $session->db->write(q|ALTER TABLE Product MODIFY specificationJSON LONGTEXT|); + $session->db->write(q|ALTER TABLE Product MODIFY featureJSON LONGTEXT|); + $session->db->write(q|ALTER TABLE Product MODIFY benefitJSON LONGTEXT|); + print "\n\t\tUpgrading DataForm fields... " unless $quiet; + $session->db->write(q|ALTER TABLE DataForm MODIFY fieldConfiguration LONGTEXT|); + $session->db->write(q|ALTER TABLE DataForm MODIFY tabConfiguration LONGTEXT|); + print "\n\t\tUpgrading DataForm entry fields... " unless $quiet; + $session->db->write(q|ALTER TABLE DataForm_entry MODIFY entryData LONGTEXT|); + print "\n\t\tUpgrading Scheduler fields... " unless $quiet; + $session->db->write(q|ALTER TABLE WorkflowSchedule MODIFY parameters LONGTEXT|); + print "\n\t\tUpgrading Workflow Instance fields... " unless $quiet; + $session->db->write(q|ALTER TABLE WorkflowInstance MODIFY parameters LONGTEXT|); + print "\n\t\tUpgrading AssetAspect Comments fields... " unless $quiet; + $session->db->write(q|ALTER TABLE assetAspectComments MODIFY comments LONGTEXT|); + print "\n\t\tUpgrading Thingy Record fields... " unless $quiet; + $session->db->write(q|ALTER TABLE ThingyRecord MODIFY fieldPrice LONGTEXT|); + print "\n\t\tUpgrading Payment Gateway fields... " unless $quiet; + $session->db->write(q|ALTER TABLE paymentGateway MODIFY options LONGTEXT|); + print "\n\t\tUpgrading Shipping driver fields... " unless $quiet; + $session->db->write(q|ALTER TABLE shipper MODIFY options LONGTEXT|); + print "\n\t\tUpgrading Tax Driver fields... " unless $quiet; + $session->db->write(q|ALTER TABLE taxDriver MODIFY options LONGTEXT|); + print "\n\t\tUpgrading Transaction Item fields... " unless $quiet; + $session->db->write(q|ALTER TABLE transactionItem MODIFY options LONGTEXT|); + $session->db->write(q|ALTER TABLE transactionItem MODIFY taxConfiguration LONGTEXT|); + print "\n\t\tUpgrading Cart Item fields... " unless $quiet; + $session->db->write(q|ALTER TABLE cartItem MODIFY options LONGTEXT|); + print "DONE!\n" unless $quiet; +} + # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index e6ae0da82..ae1de8152 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -153,31 +153,37 @@ sub definition { ##Collateral data is stored as JSON in here autoGenerate => 0, defaultValue => '[]', + fieldType=>"textarea", }, accessoryJSON => { ##Collateral data is stored as JSON in here autoGenerate => 0, defaultValue => '[]', + fieldType=>"textarea", }, relatedJSON => { ##Collateral data is stored as JSON in here autoGenerate => 0, defaultValue => '[]', + fieldType=>"textarea", }, specificationJSON => { ##Collateral data is stored as JSON in here autoGenerate => 0, defaultValue => '[]', + fieldType=>"textarea", }, featureJSON => { ##Collateral data is stored as JSON in here autoGenerate => 0, defaultValue => '[]', + fieldType=>"textarea", }, benefitJSON => { ##Collateral data is stored as JSON in here autoGenerate => 0, defaultValue => '[]', + fieldType=>"textarea", }, ); push(@{$definition}, { diff --git a/lib/WebGUI/Asset/Sku/ThingyRecord.pm b/lib/WebGUI/Asset/Sku/ThingyRecord.pm index 3850eba71..4faeee448 100644 --- a/lib/WebGUI/Asset/Sku/ThingyRecord.pm +++ b/lib/WebGUI/Asset/Sku/ThingyRecord.pm @@ -96,7 +96,7 @@ sub definition { }, fieldPrice => { tab => "properties", - fieldType => "text", + fieldType => "textarea", customDrawMethod => 'drawEditFieldPrice', label => $i18n->get( 'fieldPrice label' ), hoverHelp => $i18n->get( 'fieldPrice description'), diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm index 8f38f9151..c0d64e13a 100644 --- a/lib/WebGUI/Asset/Story.pm +++ b/lib/WebGUI/Asset/Story.pm @@ -163,7 +163,7 @@ sub definition { defaultValue => '', }, photo => { - fieldType => 'text', + fieldType => 'textarea', defaultValue => '[]', noFormPost => 1, },