WikiPage displays a locked label when locked. fixes bug #10998
This commit is contained in:
parent
96dba300f7
commit
79b849262c
6 changed files with 23 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
7.8.0
|
||||
- fixed #10998: wiki page locked?
|
||||
- fixed #10982: Survey menu options appearing twice
|
||||
- fixed #10890: Story Manager: pagination broken for keywords
|
||||
- fixed #10856: no paginate in wiki keyword search
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -299,6 +299,7 @@ sub getTemplateVars {
|
|||
allowsAttachments => $wiki->get("allowAttachments"),
|
||||
comments => $self->getFormattedComments(),
|
||||
canEdit => $self->canEdit,
|
||||
isProtected => $self->isProtected,
|
||||
content => $wiki->autolinkHtml(
|
||||
$self->scrubContent,
|
||||
{skipTitles => [$self->get('title')]},
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ our $HELP = {
|
|||
{ name => 'canEdit',
|
||||
description => 'canEdit variable',
|
||||
},
|
||||
{ name => 'isProtected', },
|
||||
{ name => 'historyLabel',
|
||||
description => 'historyLabel variable',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -91,6 +91,11 @@ our $I18N =
|
|||
lastUpdated => 1165790228,
|
||||
},
|
||||
|
||||
'locked' => {
|
||||
message => q|Locked|,
|
||||
lastUpdated => 1253139992,
|
||||
},
|
||||
|
||||
'add/edit title' => {
|
||||
message => q|Wiki Page, Add/Edit Template|,
|
||||
lastUpdated => 1165790228,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use lib "$FindBin::Bin/../lib";
|
|||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use Test::More tests => 14; # increment this value for each test you create
|
||||
use Test::More tests => 18; # increment this value for each test you create
|
||||
use WebGUI::Asset::Wobject::WikiMaster;
|
||||
use WebGUI::Asset::WikiPage;
|
||||
|
||||
|
|
@ -25,6 +25,7 @@ my $session = WebGUI::Test->session;
|
|||
my $node = WebGUI::Asset->getImportNode($session);
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
$versionTag->set({name=>"Wiki Test"});
|
||||
WebGUI::Test->tagsToRollback($versionTag);
|
||||
|
||||
my $wiki = $node->addChild({className=>'WebGUI::Asset::Wobject::WikiMaster'});
|
||||
$versionTag->commit;
|
||||
|
|
@ -32,6 +33,7 @@ my $wikipage = $wiki->addChild({className=>'WebGUI::Asset::WikiPage'});
|
|||
|
||||
# Wikis create and autocommit a version tag when a child is added. Lets get the name so we can roll it back.
|
||||
my $secondVersionTag = WebGUI::VersionTag->new($session,$wikipage->get("tagId"));
|
||||
WebGUI::Test->tagsToRollback($secondVersionTag );
|
||||
|
||||
# Test for sane object types
|
||||
isa_ok($wiki, 'WebGUI::Asset::Wobject::WikiMaster');
|
||||
|
|
@ -45,7 +47,19 @@ is($article, undef, "Can't add an Article wobject as a child to a Wiki Page.");
|
|||
my $wikiPageCopy = $wikipage->duplicate();
|
||||
isa_ok($wikiPageCopy, 'WebGUI::Asset::WikiPage');
|
||||
my $thirdVersionTag = WebGUI::VersionTag->new($session,$wikiPageCopy->get("tagId"));
|
||||
WebGUI::Test->tagsToRollback($thirdVersionTag);
|
||||
|
||||
## isProtected
|
||||
|
||||
$wikiPageCopy->update({isProtected => 1});
|
||||
ok($wikiPageCopy->isProtected, 'isProtected: copied page returns true');
|
||||
ok(! $wikipage->isProtected, '... original page is not');
|
||||
|
||||
## wiki page template variables
|
||||
|
||||
ok( ! $wikipage->getTemplateVars->{isProtected}, 'view template variables: isProtected is false on wiki page 1');
|
||||
|
||||
ok( $wikiPageCopy->getTemplateVars->{isProtected}, '... isProtected is true on wiki page 2');
|
||||
|
||||
##################
|
||||
# This section tests the Comments aspect
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue