Skip to content

Commit

Permalink
error handling imprioved for PHP 8.x compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
markusmilkereit committed Sep 1, 2023
1 parent ba7b690 commit 3affca5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/EventListener/ParseFrontendTemplateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ class ParseFrontendTemplateListener
public function __invoke(string $buffer, string $templateName, FrontendTemplate $template): string
{
if (TL_MODE == 'BE' && $templateName != 'ce_html') {
if (!$GLOBALS['objPage']) {
if (!isset($GLOBALS['objPage']) || !$GLOBALS['objPage']) {
$a = ArticleModel::findById(Input::get("id"));
$b = PageModel::findByPk($a->pid);
$GLOBALS['objPage'] = PageModel::findByPk($b->trail[0]);

if($b->trail) {
$GLOBALS['objPage'] = PageModel::findByPk($b->trail[0]);
}
}
$objIt = new InsertTags();
$buffer = $objIt->replace($buffer, true);
Expand Down

0 comments on commit 3affca5

Please sign in to comment.