Fix a call on potentially undefined parent in Gallery Album. Fixes bug #11289.
This commit is contained in:
parent
8574b68586
commit
9476878b5e
3 changed files with 17 additions and 7 deletions
|
|
@ -1,4 +1,5 @@
|
|||
7.8.8
|
||||
- fixed #11289: Gallery with pending version tag causes search engine indexer to puke.
|
||||
|
||||
7.8.7
|
||||
- fixed #11278: Wrong test for Template::Toolkit in testEnvironment.pl
|
||||
|
|
|
|||
|
|
@ -311,8 +311,7 @@ sub canEdit {
|
|||
}
|
||||
else {
|
||||
return 1 if $userId eq $self->get("ownerUserId");
|
||||
|
||||
return $gallery->canEdit($userId);
|
||||
return $gallery && $gallery->canEdit($userId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,9 @@ my $node = WebGUI::Asset->getImportNode($session);
|
|||
my $maker = WebGUI::Test::Maker::Permission->new;
|
||||
|
||||
$session->user({ userId => 3 });
|
||||
my @versionTags = ();
|
||||
push @versionTags, WebGUI::VersionTag->getWorking($session);
|
||||
$versionTags[-1]->set({name=>"Photo Test, add Gallery, Album and 1 Photo"});
|
||||
WebGUI::Test->tagsToRollback(@versionTags);
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
$versionTag->set({name=>"Photo Test, add Gallery, Album and 1 Photo"});
|
||||
WebGUI::Test->tagsToRollback($versionTag);
|
||||
|
||||
# Add a new user to the test user's friends list
|
||||
my $friend = WebGUI::User->new($session, "new");
|
||||
|
|
@ -73,7 +72,18 @@ my $photo
|
|||
{
|
||||
skipAutoCommitWorkflows => 1,
|
||||
});
|
||||
$versionTags[-1]->commit;
|
||||
|
||||
my $photo2 = $photo->cloneFromDb;
|
||||
my $album2 = $album->cloneFromDb;
|
||||
|
||||
$session->stow->delete('assetRevision');
|
||||
$versionTag->leaveTag;
|
||||
|
||||
$session->user({userId => $notFriend->userId});
|
||||
diag $album2->canEdit;
|
||||
$session->user({userId => 1});
|
||||
|
||||
$versionTag->commit;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue