Skip to content

Commit

Permalink
Don't include null results in CmsObject::listInTheme()
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Aug 25, 2023
1 parent 58c05b2 commit 257d46e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classes/CmsObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ public static function listInTheme($theme, $skipCache = false)

$loadedItems = [];
foreach ($items as $item) {
$loadedItems[] = static::loadCached($theme, $item);
$loaded = static::loadCached($theme, $item);
if ($loaded) {
$loadedItems[] = $loaded;
}
unset($loaded);
}

$result = $instance->newCollection($loadedItems);
Expand Down

0 comments on commit 257d46e

Please sign in to comment.