www_loadSurvey has to process its own macros. Fixes bug #11088.

This commit is contained in:
Colin Kuskie 2009-10-05 10:16:46 -07:00
parent a4c2908d03
commit 1953e71d76
3 changed files with 15 additions and 7 deletions

View file

@ -38,6 +38,7 @@
- fixed #11084: option to view private profiles
- fixed #11082: Admin group in Visitor group?
- fixed #11049: form caching incorrectly
- fixed #11088: i18n Survey Section Information
7.8.0
- upgraded YUI to 2.8.0r4

View file

@ -24,6 +24,7 @@ use WebGUI::Form::Country;
use WebGUI::VersionTag;
use Text::CSV_XS;
use Params::Validate qw(:all);
use WebGUI::Macro;
Params::Validate::validation_options( on_fail => sub { WebGUI::Error::InvalidParam->throw( error => shift ) } );
my $TAP_PARSER_MISSING = <<END_WARN;
@ -1256,6 +1257,8 @@ sub www_loadSurvey {
$editHtml = $self->processTemplate( $var, $self->get('answerEditTemplateId') );
}
WebGUI::Macro::process($self->session, \$editHtml);
# Generate the list of valid goto targets
my $gotoTargets = $self->surveyJSON->getGotoTargets;

View file

@ -18,18 +18,13 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 46;
plan tests => $tests + 1;
plan tests => 47;
#----------------------------------------------------------------------------
# put your tests here
my $usedOk = use_ok('WebGUI::Asset::Wobject::Survey');
my ($survey);
SKIP: {
skip $tests, "Unable to load Survey" unless $usedOk;
my $user = WebGUI::User->new( $session, 'new' );
WebGUI::Test->usersToDelete($user);
my $import_node = WebGUI::Asset->getImportNode($session);
@ -252,7 +247,6 @@ cmp_deeply(from_json($surveyEnd), { type => 'forward', url => '/getting_started'
is($survey->responseJSON->nextResponseSection()->{text}, 'new text', '..wheras the original response uses the original text');
}
}
# Test visualization
eval 'use GraphViz';
@ -314,3 +308,13 @@ cmp_deeply(
],
"Admin console submenu",
);
####################################################
#
# www_loadSurvey
#
####################################################
my $survey_json = $survey->www_loadSurvey({});
my $survey_data = JSON::from_json($survey_json);
unlike($survey_data->{edithtml}, qr/\^International/, 'www_loadSurvey process macros');