mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
typo and updated the if conditions
This commit is contained in:
parent
29be1bc504
commit
c5388b6e5b
@ -145,15 +145,15 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
|
||||
$list = new ArrayList();
|
||||
|
||||
foreach ($this->owner->hasOne() as $field => $type) {
|
||||
if(is_a(singleton($type), 'Image')) {
|
||||
if (singleton($type) instanceof Image) {
|
||||
$image = $this->owner->getComponent($field);
|
||||
if($image && $image->exists()) {
|
||||
if ($image && $image->exists()) {
|
||||
$list->push($image);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($this->owner->hasMany() as $field => $type) {
|
||||
if(is_a(singleton($type), 'Image')) {
|
||||
if (singleton($type) instanceof Image) {
|
||||
$images = $this->owner->getComponents($field);
|
||||
foreach ($images as $image) {
|
||||
if ($image && $image->exists()) {
|
||||
|
Loading…
Reference in New Issue
Block a user