From 8128f54943d178bae5492eb526cf6d50ebce2c59 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 2 Mar 2010 13:58:34 -0800 Subject: [PATCH] WebGUI now needs Test::Harness 3.17 or higher for the Survey. Fixes bug #11402. --- docs/changelog/7.x.x.txt | 1 + docs/gotcha.txt | 5 +++++ lib/WebGUI/Asset/Wobject/Survey.pm | 29 ++++------------------------- sbin/testEnvironment.pl | 1 + 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 457957c0a..458fd3df1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - fixed #11449: List of macros in my config file has HASH(0x45223ab3) entry - fixed #11443: no language switch in rich edit - fixed #11450: How to lock yourself out of your WebGUI site... + - fixed #11402: Survey TAP module requirements 7.8.13 - fixed #11418: confusing typ-o in gotcha diff --git a/docs/gotcha.txt b/docs/gotcha.txt index ca52dd04d..55209053b 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -7,6 +7,11 @@ upgrading from one version to the next, or even between multiple versions. Be sure to heed the warnings contained herein as they will save you many hours of grief. +7.9.0 +-------------------------------------------------------------------- + * WebGUI new requires Test::Harness 3.17 or higher to enable the testing functions + the Survey. + 7.8.13 -------------------------------------------------------------------- * A new gotcha was not documented in the 7.8.11 release, the new required version diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index 825cd5115..8e01d1e6f 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -27,11 +27,6 @@ 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 = <new($session, 'Asset_Survey'); my $ac = $self->getAdminConsole; - eval { require TAP::Parser }; - if ($@) { - $self->session->log->warn($TAP_PARSER_MISSING); - return $ac->render($TAP_PARSER_MISSING, $i18n->get('test results')); - } + require TAP::Parser; my $testId = $session->form->get("testId"); @@ -2983,11 +2974,7 @@ all interesting TAP::Parser and TAP::Parser::Result properties) and the template sub parseTap { my ($self, $tap) = @_; - eval { require TAP::Parser }; - if ($@) { - $self->session->log->warn($TAP_PARSER_MISSING); - return; - } + require TAP::Parser; my $parser = TAP::Parser->new( { tap => $tap } ); # Expose TAP::Parser and TAP::Parser::Result info as template variables @@ -3082,16 +3069,8 @@ sub www_runTests { my @parsers; - eval { require TAP::Parser }; - if ($@) { - $self->session->log->warn($TAP_PARSER_MISSING); - return $ac->render($TAP_PARSER_MISSING, $i18n->get('test results')); - } - eval { require TAP::Parser::Aggregator }; - if ($@) { - $self->session->log->warn($TAP_PARSER_MISSING); - return $ac->render($TAP_PARSER_MISSING, $i18n->get('test results')); - } + require TAP::Parser; + require TAP::Parser::Aggregator; my $aggregate = TAP::Parser::Aggregator->new; $aggregate->start; diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index 6f0b27ae6..027d94129 100755 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -137,6 +137,7 @@ checkModule("JavaScript::Minifier::XS", "0.05" ); checkModule("Readonly", "1.03" ); checkModule("Business::PayPal::API", "0.62" ); checkModule("Locales", "0.10" ); +checkModule("Test::Harness", "3.17" ); failAndExit("Required modules are missing, running no more checks.") if $missingModule;