diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 61a8bfef2..1acb257b5 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -2,6 +2,7 @@ - changed: the list of extensions for the export system to pass through unmodified has been moved to the configuration file under the "exportBianryExtensions" field. + - fixed: some default assets have ids shorter than 22 characters 7.6.0 - added: users may now customize the post received page for the CS diff --git a/docs/upgrades/packages-7.6.1/default_post_received.wgpkg b/docs/upgrades/packages-7.6.1/default_post_received.wgpkg new file mode 100644 index 000000000..0f5f86e63 Binary files /dev/null and b/docs/upgrades/packages-7.6.1/default_post_received.wgpkg differ diff --git a/docs/upgrades/upgrade_7.6.0-7.6.1.pl b/docs/upgrades/upgrade_7.6.0-7.6.1.pl index 7d9d597fc..aaa1fc919 100644 --- a/docs/upgrades/upgrade_7.6.0-7.6.1.pl +++ b/docs/upgrades/upgrade_7.6.0-7.6.1.pl @@ -27,7 +27,10 @@ my $quiet; # this line required my $session = start(); # this line required + addExportExtensionsToConfigFile($session); +fixShortAssetIds( $session ); + finish($session); # this line required @@ -36,7 +39,7 @@ finish($session); # this line required # this system received a backport, leave the field as is. sub addExportExtensionsToConfigFile { my $session = shift; - + print "Adding binary export extensions to config file... " unless $quiet; # skip if the field has been defined already by backporting return if defined $session->config->get('exportBinaryExtensions'); @@ -45,8 +48,30 @@ sub addExportExtensionsToConfigFile { [ qw/.html .htm .txt .pdf .jpg .css .gif .png .doc .xls .xml .rss .bmp .mp3 .js .fla .flv .swf .pl .php .php3 .php4 .php5 .ppt .docx .zip .tar .rar .gz .bz2/ ] ); + print "Done.\n" unless $quiet; } +sub fixShortAssetIds { + print "Fixing assets with short ids... " unless $quiet; + my %assetIds = ( + 'default_post_received' => 'default_post_received1', + 'SQLReportDownload0001' => 'SQLReportDownload00001', + 'UserListTmpl0000001' => 'UserListTmpl0000000001', + 'UserListTmpl0000002' => 'UserListTmpl0000000002', + 'UserListTmpl0000003' => 'UserListTmpl0000000003', + ); + while (my ($fromId, $toId) = each %assetIds) { + $session->db->write('UPDATE `template` SET `assetId`=? WHERE `assetId`=?', [$toId, $fromId]); + $session->db->write('UPDATE `assetData` SET `assetId`=? WHERE `assetId`=?', [$toId, $fromId]); + $session->db->write('UPDATE `asset` SET `assetId`=? WHERE `assetId`=?', [$toId, $fromId]); + $session->db->write('UPDATE `assetIndex` SET `assetId`=? WHERE `assetId`=?', [$toId, $fromId]); + $session->db->write('UPDATE `template` SET `assetId`=? WHERE `assetId`=?', [$toId, $fromId]); + $session->db->write('UPDATE `Collaboration` SET `postReceivedTemplateId`=? WHERE `postReceivedTemplateId`=?', [$toId, $fromId]); + $session->db->write('UPDATE `UserList` SET `templateId`=? WHERE `templateId`=?', [$toId, $fromId]); + $session->db->write('UPDATE `SQLReport` SET `downloadTemplateId`=? WHERE `downloadTemplateId`=?', [$toId, $fromId]); + } + print "Done.\n" unless $quiet; +} # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 4eec7c2f3..352679a75 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -783,11 +783,11 @@ sub definition { }, postReceivedTemplateId =>{ fieldType=>'template', - namespace=>'Collaboration', + namespace=>'Collaboration/PostReceived', tab=>'display', label=>$i18n->get('post received template'), hoverHelp=>$i18n->get('post received template hoverHelp'), - defaultValue=>'default_post_received', + defaultValue=>'default_post_received1', }, ); diff --git a/lib/WebGUI/Asset/Wobject/SQLReport.pm b/lib/WebGUI/Asset/Wobject/SQLReport.pm index 2b93aad6c..6ac5c868c 100644 --- a/lib/WebGUI/Asset/Wobject/SQLReport.pm +++ b/lib/WebGUI/Asset/Wobject/SQLReport.pm @@ -166,7 +166,7 @@ sub definition { }, downloadTemplateId=>{ fieldType=>"template", - defaultValue=>'SQLReportDownload0001', + defaultValue=>'SQLReportDownload00001', }, downloadMimeType=>{ fieldType=>"text", diff --git a/lib/WebGUI/Asset/Wobject/UserList.pm b/lib/WebGUI/Asset/Wobject/UserList.pm index 911a9efed..fa9a670be 100644 --- a/lib/WebGUI/Asset/Wobject/UserList.pm +++ b/lib/WebGUI/Asset/Wobject/UserList.pm @@ -167,7 +167,7 @@ sub definition { %properties = ( templateId =>{ fieldType=>"template", - defaultValue=>'UserListTmpl0000001', + defaultValue=>'UserListTmpl0000000001', namespace=>'UserList', tab=>"display", hoverHelp=>$i18n->get("template description"),