diff --git a/Content/PageTreeArticleDataProvider.php b/Content/PageTreeArticleDataProvider.php index 09ee53bd..6f631b2d 100644 --- a/Content/PageTreeArticleDataProvider.php +++ b/Content/PageTreeArticleDataProvider.php @@ -64,7 +64,7 @@ protected function createSearch(Search $search, array $filters, string $locale): if ($document instanceof BasePageDocument && $document->getResourceSegment()) { // the selected data-source could be removed - $search->addQuery(new PrefixQuery('route_path.raw', $document->getResourceSegment())); + $search->addQuery(new PrefixQuery('route_path.raw', $document->getResourceSegment() . '/')); } return $search; diff --git a/Tests/Functional/Content/PageTreeArticleDataProviderTest.php b/Tests/Functional/Content/PageTreeArticleDataProviderTest.php index 523a8d11..8de16897 100644 --- a/Tests/Functional/Content/PageTreeArticleDataProviderTest.php +++ b/Tests/Functional/Content/PageTreeArticleDataProviderTest.php @@ -51,7 +51,9 @@ public function setUp(): void public function testFilterByDataSource() { $page1 = $this->createPage('Test Page', '/page-1'); - $page2 = $this->createPage('Test Page', '/page-2'); + + // Tests additionally that the trailing slash in the prefix query is there + $page2 = $this->createPage('Test Page', '/page-1-1'); $articles = [ $this->createArticle($page1, 'Test 1'),