Skip to content

Commit

Permalink
Small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
kozi committed Sep 22, 2014
1 parent f35732f commit 18b6185
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions contao/classes/MetaFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,38 +74,39 @@ private function getMultiMetaData($multiSRC) {
$images = array();
$objFiles = \FilesModel::findMultipleByUuids(unserialize($multiSRC));

while ($objFiles->next()) {
// Continue if the files has been processed or does not exist
if (isset($images[$objFiles->path]) || !file_exists(TL_ROOT . '/' . $objFiles->path)) {
continue;
}
// Single files
if ($objFiles->type == 'file') {
$objFile = new \File($objFiles->path, true);
if (!$objFile->isGdImage) {
if($objFiles !== null) {
while ($objFiles->next()) {
// Continue if the files has been processed or does not exist
if (isset($images[$objFiles->path]) || !file_exists(TL_ROOT . '/' . $objFiles->path)) {
continue;
}
$images[$objFiles->path] = $this->getMetaData($objFiles->meta, $objPage->language);
}
else {
$objSubfiles = \FilesModel::findByPid($objFiles->uuid);
if ($objSubfiles === null) {
continue;
}
while ($objSubfiles->next()) {
// Skip subfolders
if ($objSubfiles->type == 'folder') {
// Single files
if ($objFiles->type == 'file') {
$objFile = new \File($objFiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$objFile = new \File($objSubfiles->path, true);

if (!$objFile->isGdImage) {
$images[$objFiles->path] = $this->getMetaData($objFiles->meta, $objPage->language);
} else {
$objSubfiles = \FilesModel::findByPid($objFiles->uuid);
if ($objSubfiles === null) {
continue;
}
$images[$objFile->path] = $this->getMetaData($objSubfiles->meta, $objPage->language);
while ($objSubfiles->next()) {
// Skip subfolders
if ($objSubfiles->type == 'folder') {
continue;
}
$objFile = new \File($objSubfiles->path, true);

if (!$objFile->isGdImage) {
continue;
}
$images[$objFile->path] = $this->getMetaData($objSubfiles->meta, $objPage->language);
}
}
}
}
} // END if($objFiles !== null)
return $images;
}

Expand Down

0 comments on commit 18b6185

Please sign in to comment.