Skip to content

Commit

Permalink
fix objPage sometimes being an int instead of PageModel
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyborn committed Apr 27, 2023
1 parent 751e8a2 commit 12947a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Resources/contao/classes/OpenGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public static function addTagsToPage( $ref=null ): void {

$objPage = System::getContainer()->get('request_stack')->getCurrentRequest()->get('pageModel');

if( !($objPage instanceof PageModel) ){
$objPage = PageModel::findById($objPage);
}

$objRef = !$ref ? $objPage : $ref;
$objRootPage = ($objRef instanceof PageModel) ? PageModel::findById($objPage->rootId) : null;

Expand Down

0 comments on commit 12947a9

Please sign in to comment.