Skip to content

Commit

Permalink
Fixed error calling addImageToTemplate of the content gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
hschottm committed Mar 7, 2023
1 parent 1d3dda1 commit 718d810
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions elements/ContentGalleryTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,16 @@ public function compile()
/**
* Add an image to a template
*
* @param object $template The template object to add the image to
* @param array $rowData The element or module as array
* @param integer|null $maxWidth An optional maximum width of the image
* @param string|null $lightboxGroupIdentifier An optional lightbox group identifier
* @param FilesModel|null $filesModel An optional files model
* @param object $objTemplate The template object to add the image to
* @param array $arrItem The element or module as array
* @param integer $intMaxWidth An optional maximum width of the image
* @param string $strLightboxId An optional lightbox ID
*/
public static function addImageToTemplate($template, array $rowData, $maxWidth = null, $lightboxGroupIdentifier = null, FilesModel $filesModel = null): void
public static function addImageToTemplate($objTemplate, $arrItem, $intMaxWidth=null, $strLightboxId=null)
{
Controller::addImageToTemplate($template, $rowData, $maxWidth, $lightboxGroupIdentifier, $filesModel);
Controller::addImageToTemplate($objTemplate, $arrItem, $intMaxWidth, $strLightboxId);
if (TL_MODE == 'FE') {
$found = \TagModel::findByIdAndTable($rowData['id'], 'tl_files');
$found = \TagModel::findByIdAndTable($arrItem['id'], 'tl_files');
$tags = array();
if ($found && $found->count()) {
while ($found->next()) {
Expand Down
2 changes: 1 addition & 1 deletion modules/ModuleEventReaderTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ protected function compile()
}

$arrEvent['singleSRC'] = $objModel->path;
$this->addImageToTemplate($objTemplate, $arrEvent, null, null, $objModel);
$this->addImageToTemplate($objTemplate, $arrEvent, null, null);
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/ModuleEventlistTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ protected function compile()
}

$event['singleSRC'] = $objModel->path;
$this->addImageToTemplate($objTemplate, $event, null, null, $objModel);
$this->addImageToTemplate($objTemplate, $event, null, null);

// Link to the event if no image link has been defined
if (!$objTemplate->fullsize && !$objTemplate->imageUrl)
Expand Down

0 comments on commit 718d810

Please sign in to comment.