From 1953e71d76971d4095a0f056433eb04b0d674d9f Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 5 Oct 2009 10:16:46 -0700 Subject: [PATCH] www_loadSurvey has to process its own macros. Fixes bug #11088. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Survey.pm | 3 +++ t/Asset/Wobject/Survey.t | 18 +++++++++++------- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 837c0bada..d94b735c1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -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 diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index 58022db24..37bbbb0e0 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -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 = <processTemplate( $var, $self->get('answerEditTemplateId') ); } + WebGUI::Macro::process($self->session, \$editHtml); + # Generate the list of valid goto targets my $gotoTargets = $self->surveyJSON->getGotoTargets; diff --git a/t/Asset/Wobject/Survey.t b/t/Asset/Wobject/Survey.t index 05a7fdc4f..113277888 100644 --- a/t/Asset/Wobject/Survey.t +++ b/t/Asset/Wobject/Survey.t @@ -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');