Fixed bug #10982 where survey admin menu options appear twice. Caused by the Survey Asset directly calling its parent getAdminConsole method instead of instantiating a session instance of the method.

This commit is contained in:
hao 2009-09-15 12:02:49 -04:00
parent 5ee64a57d3
commit 082b04b967
3 changed files with 45 additions and 2 deletions

View file

@ -1,4 +1,5 @@
7.8.0
- fixed #10982: Survey menu options appearing twice
- fixed #10890: Story Manager: pagination broken for keywords
- fixed #10856: no paginate in wiki keyword search
- fixed #10877: getProfileUrl() broken

View file

@ -691,7 +691,7 @@ test suite.
sub getAdminConsole {
my $self = shift;
my $ac = $self->SUPER::getAdminConsole;
my $ac = WebGUI::AdminConsole->new( $self->session, 'Survey' );
my $i18n = WebGUI::International->new($self->session, "Asset_Survey");
$ac->addSubmenuItem($self->session->url->page("func=edit"), WebGUI::International->new($self->session, "WebGUI")->get(575));
$ac->addSubmenuItem($self->session->url->page("func=editSurvey"), $i18n->get('edit survey'));

View file

@ -18,7 +18,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 45;
my $tests = 46;
plan tests => $tests + 1;
#----------------------------------------------------------------------------
@ -272,3 +272,45 @@ like($storage->getFileContentsAsScalar($filename), qr{
}
my $adminConsole = $survey->getAdminConsole();
cmp_deeply(
$adminConsole->{_submenuItem},
[
{
'extras' => undef,
'url' => '/home?func=edit',
'label' => 'Edit'
},
{
'extras' => undef,
'url' => '/home?func=editSurvey',
'label' => 'Edit Survey'
},
{
'extras' => undef,
'url' => '/home?func=takeSurvey',
'label' => 'Take Survey'
},
{
'extras' => undef,
'url' => '/home?func=graph',
'label' => 'Visualize'
},
{
'extras' => undef,
'url' => '/home?func=editTestSuite',
'label' => 'Test Suite'
},
{
'extras' => undef,
'url' => '/home?func=runTests',
'label' => 'Run All Tests'
},
{
'extras' => undef,
'url' => '/home?func=runTests;format=tap',
'label' => 'Run All Tests (TAP)'
}
],
"Admin console submenu",
);