mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
FIX for #78 to workaround ->alterCanIncludeInGoogleSitemap() not working due to core bug with ->invokeWithExtensions() not allowing references.
This commit is contained in:
parent
99282db32a
commit
5228024ba5
@ -33,7 +33,13 @@ class GoogleSitemapExtension extends DataExtension
|
||||
$can = $this->owner->getGooglePriority();
|
||||
}
|
||||
|
||||
$this->owner->invokeWithExtensions('alterCanIncludeInGoogleSitemap', $can);
|
||||
// Allow override. In this case, since this can return multiple results, we'll use an "and" based policy. That is
|
||||
// if any value is false then the current value will be false. Only only if all are true will we then return true.
|
||||
$override = $this->owner->invokeWithExtensions('alterCanIncludeInGoogleSitemap', $can);
|
||||
if ($override) {
|
||||
$can = min($override);
|
||||
}
|
||||
|
||||
|
||||
return $can;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user