Fix bad Event URL template variables.

This commit is contained in:
Colin Kuskie 2009-04-27 18:39:14 +00:00
parent 15f1391a01
commit 142518035d
6 changed files with 69 additions and 4 deletions

View file

@ -6,6 +6,7 @@
- fixed #10209: Changing existing user profile field type doesn't change underlying database column type
- fixed #10047: SQLReport Debug doesn't catch when bind variables are incorrect
- fixed #10260: WebGUI::Asset::Wobject::Gallery.pm default search date misfunction
- fixed #10238: Edit Calendar Event not working when proxy cache disabled
7.7.4
- rfe: Extend DateTime for Week-Nrs (#9151)

View file

@ -15,6 +15,15 @@ save you many hours of grief.
the requirements for the new type. The most common place this problem
would be noticed would be if a text field was changed to HTML field.
* The Event url template variable was being used incorrectly. This has
been fixed, but requires new template variables for viewing a list
of events, printing events and editing and deleting events. Please
check the online Help for the new template variables.
Event templates using HTML::Template are automatically updated. If your
site uses a different parser for this template it will need to be manually
upgraded.
7.7.4
--------------------------------------------------------------------
* WebGUI now requires XML::FeedPP version 0.40 or greater.

View file

@ -38,6 +38,8 @@ installStoryManagerTables($session);
sm_upgradeConfigFiles($session);
sm_updateDailyWorkflow($session);
correctEventTemplateVariables($session);
finish($session); # this line required
@ -140,6 +142,31 @@ sub sm_updateDailyWorkflow {
print "DONE!\n" unless $quiet;
}
sub correctEventTemplateVariables {
my ($session) = @_;
print "\tCorrect Event Template Variables for URL actions... " unless $quiet;
my $root = WebGUI::Asset->getRoot($session);
my $getATemplate = $root->getLineageIterator(['descendants'], {
returnObjects => 1,
includeOnlyClasses => ['WebGUI::Asset::Template'],
joinClass => 'WebGUI::Asset::Template',
whereClause => q!template.namespace = 'Calendar/Event' and template.parser='WebGUI::Asset::Template::HTMLTemplate'!,
});
TEMPLATE: while (my $templateAsset = $getATemplate->()) {
print("\t\t Correcting ". $templateAsset->getTitle. "\n") unless $quiet;
my $template = $templateAsset->get('template');
$template =~ s{<tmpl_var url>\?func=edit}{<tmpl_var urlEdit>}isg;
$template =~ s{<tmpl_var url>\?func=delete}{<tmpl_var urlDelete>}isg;
$template =~ s{<tmpl_var url>\?print=1}{<tmpl_var urlPrint>}isg;
$template =~ s{<tmpl_var url>\?type=list}{<tmpl_var urlList>}isg;
$templateAsset->update({
template => $template,
});
}
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------