mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
If invokeWithExtensions returns an empty array, don't override
This commit is contained in:
parent
710b8c3518
commit
2860c390b0
@ -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;
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ class GoogleSitemapTest extends FunctionalTest
|
||||
$this->assertFalse($unused->canIncludeInGoogleSitemap());
|
||||
|
||||
$used = $this->objFromFixture(TestDataObject::class, 'DataObjectTest2');
|
||||
|
||||
$this->assertTrue($used->canIncludeInGoogleSitemap());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user