From f7b02c0407c7c7d52536d53d1968ab9a05dc055e Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 2 Oct 2008 15:12:20 +0000 Subject: [PATCH] fixed: some default assets have ids shorter than 22 characters --- docs/changelog/7.x.x.txt | 1 + .../default_post_received.wgpkg | Bin 0 -> 834 bytes docs/upgrades/upgrade_7.6.0-7.6.1.pl | 27 +++++++++++++++++- lib/WebGUI/Asset/Wobject/Collaboration.pm | 4 +-- lib/WebGUI/Asset/Wobject/SQLReport.pm | 2 +- lib/WebGUI/Asset/Wobject/UserList.pm | 2 +- 6 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 docs/upgrades/packages-7.6.1/default_post_received.wgpkg 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 0000000000000000000000000000000000000000..0f5f86e636b398585f9bd8804e03d58ebac5445b GIT binary patch literal 834 zcmV-I1HJqoiwFP!00000|Ls*>Z__Xo?K8i^$}@CM+BI8MDs|&yLt~V&@gYEyo7|>m zscmd$r6B%0*G{^WwoE*%5<>Gs9r<2gAD?rs+iYxqP)g(7-A2RBopPp8yU`#wgEqpD z#v$#rI<(aw_z^}8f~ngdg|SQ{wCqYqb<1&>HXh#+$IIdHm-O>3ssB>QqYmreXy1Le z!sZtv#T@~~f}J+%jq@h`qqyB#(Z5Y&v;nfY{jn|mo7;ze7bpC9fK3<}D>cg?AYJnD z^FzO+v{axi2jff!`yFJiiHJ`&eH;P{k*eH3fW9!GkJD8k@Xcy=1S~yg+4@Fi4A^Q@3S(B} z_EJe>FEu2aop_=oP6Ex z`GTb1{dG8DBHLt6%WYm3dQxgmhK|v*O7r^EN|?7CN-xHBh#Myt8&!ptd}6M+I+d1> zd4hb(H6u(x6z6}7z%@$YeH$=^nxZ9Z4BowO`1kTI?cJyjDW$^zh`PFI)lAIjfk5!bAz3`N`}AZg1_b063yh_%1w6iPwXl= zG2Nrl5;-V0wpa!4`RS{HdB4AReQ0v};%qjaojl62z`f%?AN;(Fzlr-A_YB-K@Econfig->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"),