mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
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:
commit
188f77c569
@ -217,11 +217,13 @@ class PagesDueForReviewReport extends Report
|
|||||||
$records = $records->filterByCallback(function ($page) use ($currentUser) {
|
$records = $records->filterByCallback(function ($page) use ($currentUser) {
|
||||||
$options = $page->getOptions();
|
$options = $page->getOptions();
|
||||||
|
|
||||||
|
if ($options) {
|
||||||
foreach ($options->ContentReviewOwners() as $owner) {
|
foreach ($options->ContentReviewOwners() as $owner) {
|
||||||
if ($currentUser->ID == $owner->ID) {
|
if ($currentUser->ID == $owner->ID) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -68,9 +68,10 @@ class ContentReviewEmails extends BuildTask
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$option = $page->getOptions();
|
$options = $page->getOptions();
|
||||||
|
|
||||||
foreach ($option->ContentReviewOwners() as $owner) {
|
if ($options) {
|
||||||
|
foreach ($options->ContentReviewOwners() as $owner) {
|
||||||
if (!isset($overduePages[$owner->ID])) {
|
if (!isset($overduePages[$owner->ID])) {
|
||||||
$overduePages[$owner->ID] = ArrayList::create();
|
$overduePages[$owner->ID] = ArrayList::create();
|
||||||
}
|
}
|
||||||
@ -78,6 +79,7 @@ class ContentReviewEmails extends BuildTask
|
|||||||
$overduePages[$owner->ID]->push($page);
|
$overduePages[$owner->ID]->push($page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $overduePages;
|
return $overduePages;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user