Skip to content

Commit

Permalink
Fixed gallery element tags generation if there are not tags defined f…
Browse files Browse the repository at this point in the history
…or a file
  • Loading branch information
hschottm committed Mar 24, 2017
1 parent 75f2580 commit 65de9ac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions elements/ContentGalleryTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,14 @@ public static function addImageToTemplate($objTemplate, $arrItem, $intMaxWidth=n
{
$found = \TagModel::findByIdAndTable($arrItem['id'], 'tl_files');
$tags = array();
while ($found->next())
if ($found && $found->count())
{
array_push($tags, $found->tag);
while ($found->next())
{
array_push($tags, $found->tag);
}
$objTemplate->tags = $tags;
}
$objTemplate->tags = $tags;
}
}

Expand Down

0 comments on commit 65de9ac

Please sign in to comment.