Handle cases such as 'Class.RelationName'

This commit is contained in:
Will Rossiter 2020-11-20 09:01:40 +13:00 committed by GitHub
parent a333b56711
commit 67c8ad044e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -162,7 +162,11 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
foreach ($this->owner->manyMany() as $field => $type) {
$image = false;
if (strpos($type, '.') !== false) {
$type = explode('.', $type)[0];
}
if (is_array($type) && isset($type['through'])) {
if (singleton($type['through']) instanceof Image) {
$image = true;