Skip to content

Commit

Permalink
Use correct site tree when adding an external link
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Nov 8, 2024
1 parent 400de02 commit aa8b1e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion concrete/src/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ public function addCollectionAliasExternal($cName, $cLink, $newWindow = 0)
$cInheritPermissionsFromCID = $this->getPermissionsCollectionID();
$cInheritPermissionsFrom = 'PARENT';

$siteTreeID = \Core::make('site')->getSite()->getSiteTreeID();
$siteTreeID = $this->getSiteTreeID() ?: \Core::make('site')->getSite()->getSiteTreeID();

$v = [$newCID, $siteTreeID, $cParentID, $uID, $cInheritPermissionsFrom, (int) $cInheritPermissionsFromCID, $cLink, $newWindow];
$q = 'insert into Pages (cID, siteTreeID, cParentID, uID, cInheritPermissionsFrom, cInheritPermissionsFromCID, cPointerExternalLink, cPointerExternalLinkNewWindow) values (?, ?, ?, ?, ?, ?, ?, ?)';
Expand Down

0 comments on commit aa8b1e9

Please sign in to comment.