Fix broken templateId in Session/Style/process when useEmptyStyle was

requested.  It used to be 6, but at somepoint in the 6.x cycle it
was changed to be PBtmpl0000000000000132 in the database.

Added tests that verify that it works correctly.
This commit is contained in:
Colin Kuskie 2006-10-11 00:32:42 +00:00
parent 6cf1afc6a7
commit b1bb5d0b58
3 changed files with 9 additions and 3 deletions

View file

@ -12,6 +12,7 @@
- fix: Events Calendar: error in "big" template (Martin Kamerbeek / Procolix) - fix: Events Calendar: error in "big" template (Martin Kamerbeek / Procolix)
- fix: PM task editor not preserving duration - fix: PM task editor not preserving duration
- fix: PM project completion percentage updates not working right - fix: PM project completion percentage updates not working right
- fix: useEmptyStyle caused invalid template to be used
- Added ability to download an SQLReport in either CSV or as a template. - Added ability to download an SQLReport in either CSV or as a template.
- Added ability for Products to add a user to a group when purchased. - Added ability for Products to add a user to a group when purchased.
- Changed the ?op=editProduct form to a TabForm. - Changed the ?op=editProduct form to a TabForm.

View file

@ -159,7 +159,7 @@ sub process {
} elsif ($self->session->scratch->get("personalStyleId") ne "") { } elsif ($self->session->scratch->get("personalStyleId") ne "") {
$templateId = $self->session->scratch->get("personalStyleId"); $templateId = $self->session->scratch->get("personalStyleId");
} elsif ($self->{_useEmptyStyle}) { } elsif ($self->{_useEmptyStyle}) {
$templateId = 6; $templateId = 'PBtmpl0000000000000132';
} }
$var{'head.tags'} = ' $var{'head.tags'} = '
<meta name="generator" content="WebGUI '.$WebGUI::VERSION.'" /> <meta name="generator" content="WebGUI '.$WebGUI::VERSION.'" />

View file

@ -18,7 +18,7 @@ use WebGUI::Session;
use WebGUI::Asset; use WebGUI::Asset;
use WebGUI::VersionTag; use WebGUI::VersionTag;
use Test::More tests => 38; # increment this value for each test you create use Test::More tests => 39; # increment this value for each test you create
use Test::Deep; use Test::Deep;
my $session = WebGUI::Test->session; my $session = WebGUI::Test->session;
@ -151,6 +151,7 @@ is($macroOutput, 1, 'generateAdditionalHeadTags: process a macro');
#################################################### ####################################################
# #
# process # process
# useEmptyStyle
# #
#################################################### ####################################################
@ -163,6 +164,10 @@ is($style->process('body.content', 'notATemplateId'),
is($style->sent, 1, 'process: sets sent to 1'); is($style->sent, 1, 'process: sets sent to 1');
$style->useEmptyStyle(1);
is($style->process('body.content'), "body.content", 'process, useEmptyStyle: valid data returned');
my ($versionTag, $personalTemplate) = setup_assets($session); my ($versionTag, $personalTemplate) = setup_assets($session);
$session->scratch->set('personalStyleId', $personalTemplate->getId); $session->scratch->set('personalStyleId', $personalTemplate->getId);