diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 66d4758b6..aacaa2fce 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -25,14 +25,6 @@ save you many hours of grief. -------------------------------------------------------------------- * WebGUI now depends on PerlIO::eol, for doing line ending translation. - * As part of the migration to Template::Toolkit, we will be changing template - variables from using dots to underscores. All templates using that namespace were - automatically upgraded to use the new variables. - - In this version, these templates were updated: - Account Macro template - Admin Toggle Macro template - 7.10.0 -------------------------------------------------------------------- * Due to a bug in the 7.8.24-7.9.11 upgrade, the ordering of template diff --git a/docs/templates.txt b/docs/templates.txt index 8680a747a..921d98dd5 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -13,14 +13,6 @@ templates, you will need to apply these changes manually to your copies. 7.10.1 - * Account Macro template variables renamed: - account.url => account_url - account.text => account_text - - * AdminToggle Macro template variables renamed: - toggle.url => toggle_url - toggle.text => toggle_text - * Asset Report Template - asset-report/asset-report-default-template Remove the empty template attachment diff --git a/docs/upgrades/upgrade_7.10.0-7.10.1.pl b/docs/upgrades/upgrade_7.10.0-7.10.1.pl index 621af5c02..d9d3b54d2 100644 --- a/docs/upgrades/upgrade_7.10.0-7.10.1.pl +++ b/docs/upgrades/upgrade_7.10.0-7.10.1.pl @@ -107,7 +107,7 @@ sub repackTemplates { template => $asset->get('template'), }); } - print "\t... DONE!\n" unless $quiet; + print "DONE!\n" unless $quiet; print "\tRepacking head tags in all assets, this may take a while..." unless $quiet; $sth = $session->db->read( "SELECT assetId, revisionDate FROM assetData where usePackedHeadTags=1" ); @@ -118,7 +118,7 @@ sub repackTemplates { extraHeadTags => $asset->get('extraHeadTags'), }); } - print "\t... DONE!\n" unless $quiet; + print "DONE!\n" unless $quiet; print "\tRepacking all snippets, this may take a while..." unless $quiet; $sth = $session->db->read( "SELECT assetId, revisionDate FROM snippet" ); @@ -130,50 +130,10 @@ sub repackTemplates { }); } - print "\t... DONE!\n" unless $quiet; + print "DONE!\n" unless $quiet; } -#---------------------------------------------------------------------------- -# Rename template variables -sub renameAccountMacroTemplateVariables { - my $session = shift; - - print "\tRename Account Macro template variables..." unless $quiet; - my $sth = $session->db->read( q|SELECT assetId, revisionDate FROM template where namespace="Macro/a_account"| ); - while ( my ($assetId, $revisionDate) = $sth->array ) { - my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate ); - next unless $asset; - my $template = $asset->get('template'); - $template =~ s/account\.url/account_url/msg; - $template =~ s/account\.text/account_text/msg; - $asset->update({ - template => $template, - }); - } - print "\t... DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Rename template variables -sub renameAdminToggleMacroTemplateVariables { - my $session = shift; - - print "\tRename Admin Toggle Macro template variables..." unless $quiet; - my $sth = $session->db->read( q|SELECT assetId, revisionDate FROM template where namespace="Macro/AdminToggle"| ); - while ( my ($assetId, $revisionDate) = $sth->array ) { - my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId, $revisionDate ); - next unless $asset; - my $template = $asset->get('template'); - $template =~ s/toggle\.url/toggle_url/msg; - $template =~ s/toggle\.text/toggle_text/msg; - $asset->update({ - template => $template, - }); - } - print "\t... DONE!\n" unless $quiet; -} - #---------------------------------------------------------------------------- # Describe what our function does #sub exampleFunction { @@ -237,8 +197,6 @@ sub finish { my $session = shift; updateTemplates($session); repackTemplates( $session ); - renameAccountMacroTemplateVariables( $session ); - renameAdminToggleMacroTemplateVariables( $session ); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->commit; $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); diff --git a/lib/WebGUI/Help/Macro_AdminToggle.pm b/lib/WebGUI/Help/Macro_AdminToggle.pm index 54dc9b9de..67164c6b4 100644 --- a/lib/WebGUI/Help/Macro_AdminToggle.pm +++ b/lib/WebGUI/Help/Macro_AdminToggle.pm @@ -6,16 +6,7 @@ our $HELP = { 'admin toggle' => { title => 'admin toggle title', body => '', - variables => [ - { - name => 'toggle_url', - description => 'toggle.url', - }, - { - name => 'toggle_text', - description => 'toggle.text', - }, - ], + variables => [ { 'name' => 'toggle.url' }, { 'name' => 'toggle.text' } ], fields => [], related => [] }, diff --git a/lib/WebGUI/Help/Macro_a_account.pm b/lib/WebGUI/Help/Macro_a_account.pm index ab215bbaf..f38d70e6a 100644 --- a/lib/WebGUI/Help/Macro_a_account.pm +++ b/lib/WebGUI/Help/Macro_a_account.pm @@ -7,16 +7,7 @@ our $HELP = { title => 'account title', body => '', fields => [], - variables => [ - { - name => 'account_url', - description => 'account.url', - }, - { - name => 'account_text', - description => 'account.text', - } - ], + variables => [ { 'name' => 'account.url' }, { 'name' => 'account.text' } ], related => [] }, diff --git a/lib/WebGUI/Macro/a_account.pm b/lib/WebGUI/Macro/a_account.pm index 1f63d879f..3f6821318 100644 --- a/lib/WebGUI/Macro/a_account.pm +++ b/lib/WebGUI/Macro/a_account.pm @@ -44,8 +44,8 @@ sub process { my @param = @_; return $session->url->page("op=auth;method=init") if ($param[0] eq "linkonly"); my $i18n = WebGUI::International->new($session,'Macro_a_account'); - $var{'account_url'} = $session->url->page('op=auth;method=init'); - $var{'account_text'} = $param[0] || $i18n->get(46); + $var{'account.url'} = $session->url->page('op=auth;method=init'); + $var{'account.text'} = $param[0] || $i18n->get(46); if ($param[1]) { return WebGUI::Asset::Template->newByUrl($session, $param[1])->process(\%var); } else { diff --git a/t/Macro/AdminToggle.t b/t/Macro/AdminToggle.t index e6efb6b24..35f39513f 100644 --- a/t/Macro/AdminToggle.t +++ b/t/Macro/AdminToggle.t @@ -102,7 +102,7 @@ sub addTemplate { className => 'WebGUI::Asset::Template', url => 'admintoggle-test', namespace => 'Macro/AdminToggle', - template => "HREF=\nLABEL=", + template => "HREF=\nLABEL=", id => 'AdminToggleTemplate--Z', usePacked => 0, }; diff --git a/t/Macro/a_account.t b/t/Macro/a_account.t index 2db2cded0..29c63f7f9 100644 --- a/t/Macro/a_account.t +++ b/t/Macro/a_account.t @@ -90,7 +90,7 @@ sub addTemplate { className => 'WebGUI::Asset::Template', url => 'a_account-test', namespace => 'Macro/a_account', - template => "HREF=\nLABEL=", + template => "HREF=\nLABEL=", id => 'testTemplatea_account1', usePacked => 1, };