If invokeWithExtensions returns an empty array, don't override

This commit is contained in:
Will Rossiter 2019-04-30 15:45:39 +12:00
parent 710b8c3518
commit 2860c390b0
No known key found for this signature in database
GPG Key ID: F24330E3B4B95B75
2 changed files with 4 additions and 1 deletions

View File

@ -58,7 +58,9 @@ class GoogleSitemapExtension extends DataExtension
if ($override !== null) {
if (is_array($override)) {
$can = min($override, $can);
if (!empty($override)) {
$can = min($override, $can);
}
} else {
$can = $override;
}

View File

@ -60,6 +60,7 @@ class GoogleSitemapTest extends FunctionalTest
$this->assertFalse($unused->canIncludeInGoogleSitemap());
$used = $this->objFromFixture(TestDataObject::class, 'DataObjectTest2');
$this->assertTrue($used->canIncludeInGoogleSitemap());
}