Fix upgrade error that was hit on 7.7.21 to 7.7.22. Fixes bug #11146

This commit is contained in:
Colin Kuskie 2009-10-16 16:53:53 -07:00
parent 9d52245135
commit 846b957a78
2 changed files with 3 additions and 1 deletions

View file

@ -95,7 +95,8 @@ sub correctWikiAttachmentPermissions {
PAGE: while (my $wikiPage = $pageIterator->()) {
my $wiki = $wikiPage->getWiki;
next PAGE unless $wiki && $wiki->get('allowAttachments') && $wikiPage->getChildCount;
foreach my $attachment (@{ $wikiPage->getLineage(['children'])}) {
ATTACHMENT: foreach my $attachment (@{ $wikiPage->getLineage(['children'], { returnObjects => 1, })}) {
next ATTACHMENT unless $attachment;
$attachment->update({ groupIdEdit => $wiki->get('groupToEditPages') });
}
}