Merge pull request #99 from patricknelson/issue-78-invoke-byref-issue

FIX for #78 to workaround ->alterCanIncludeInGoogleSitemap() not working
This commit is contained in:
Daniel Hensby 2016-02-26 10:41:03 +00:00
commit b7da114f99
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}