diff --git a/application/models/Collection.php b/application/models/Collection.php index 2cf47bb884..bea5a4ef07 100644 --- a/application/models/Collection.php +++ b/application/models/Collection.php @@ -225,10 +225,19 @@ public function getFile() 'sort_field' => 'featured', 'sort_dir' => 'd' ), 1); - if ($itemArray) { - return ($itemArray[0]->getFile()); - } else { - return null; - } - } + if ($itemArray) { + return ($itemArray[0]->getFile()); + } else { + // In case no Item with an image was found + $itemArray = $itemTable->findBy(array( + 'collection' => $this->id, + 'sort_field' => 'featured', + 'sort_dir' => 'd' + ), 1); + if ($itemArray) { + return ($itemArray[0]->getFile()); + } else { + return null; + } + } }