Merge pull request #102 from pjayme/bugfix/ownergroups-check-before-method-call

BUGFIX: Error trying to access OwnerGroups() method on boolean value
This commit is contained in:
Robbie Averill 2018-08-22 08:48:58 +12:00 committed by GitHub
commit 188f77c569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View File

@ -217,9 +217,11 @@ class PagesDueForReviewReport extends Report
$records = $records->filterByCallback(function ($page) use ($currentUser) { $records = $records->filterByCallback(function ($page) use ($currentUser) {
$options = $page->getOptions(); $options = $page->getOptions();
foreach ($options->ContentReviewOwners() as $owner) { if ($options) {
if ($currentUser->ID == $owner->ID) { foreach ($options->ContentReviewOwners() as $owner) {
return true; if ($currentUser->ID == $owner->ID) {
return true;
}
} }
} }

View File

@ -68,14 +68,16 @@ class ContentReviewEmails extends BuildTask
continue; continue;
} }
$option = $page->getOptions(); $options = $page->getOptions();
foreach ($option->ContentReviewOwners() as $owner) { if ($options) {
if (!isset($overduePages[$owner->ID])) { foreach ($options->ContentReviewOwners() as $owner) {
$overduePages[$owner->ID] = ArrayList::create(); if (!isset($overduePages[$owner->ID])) {
$overduePages[$owner->ID] = ArrayList::create();
}
$overduePages[$owner->ID]->push($page);
} }
$overduePages[$owner->ID]->push($page);
} }
} }