diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 0236d02c8..047e88eb1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -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 diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index d12945e50..1be5c0f3a 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -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')); diff --git a/t/Asset/Wobject/Survey.t b/t/Asset/Wobject/Survey.t index 8b41f31b5..05a7fdc4f 100644 --- a/t/Asset/Wobject/Survey.t +++ b/t/Asset/Wobject/Survey.t @@ -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", +);