Skip to content

Commit

Permalink
Fix filtering by parent page in a secondary language
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Nov 27, 2024
1 parent 9ade229 commit 7331d7a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public function exportCollection(ObjectCollection $collection, \SimpleXMLElement
public function getResults(Request $request)
{
$pl = new PageList();
$site = \Core::make('site')->getActiveSiteForEditing();
$pl->setSiteTreeObject($site->getSiteTreeObject());
$query = $request->query->all();

$keywords = $query['keywords'];
Expand All @@ -37,7 +35,11 @@ public function getResults(Request $request)
if ($startingPoint) {
$parent = \Page::getByID($startingPoint, 'ACTIVE');
$pl->filterByPath($parent->getCollectionPath());
$siteTree = $parent->getSiteTreeObject();
} else {
$siteTree = app('site')->getActiveSiteForEditing()->getSiteTreeObject();
}
$pl->setSiteTreeObject($siteTree);
if ($datetime) {
$pl->filterByPublicDate($datetime, '>=');
}
Expand Down

0 comments on commit 7331d7a

Please sign in to comment.