87549[FEATURE] Add search by page URI in page tree filter and livesearch
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Anja Leichsenring +1
- Sven Liebert +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Georg Ringer +2
- Anja Leichsenring +1
- Sven Liebert +1
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 3
Files 22
- Build/Sources/TypeScript/backend/tree/page-tree-element.ts+77 −20
- typo3/sysext/backend/Classes/Controller/Page/TreeController.php+12 −0
- typo3/sysext/backend/Classes/Search/Event/ModifyConstraintsForLiveSearchEvent.php2new+71 −0
- typo3/sysext/backend/Classes/Search/EventListener/AddLiveSearchFrontendUriResolverListener.phpnew+80 −0
- typo3/sysext/backend/Classes/Search/LiveSearch/DatabaseRecordProvider.php+3 −0
- typo3/sysext/backend/Classes/Search/LiveSearch/PageRecordProvider.php+3 −0
- typo3/sysext/backend/Classes/Tree/Repository/PageTreeFilter.php+122 −11
- typo3/sysext/backend/Configuration/user.tsconfig+1 −0
- typo3/sysext/backend/Resources/Private/Language/locallang.xlf+3 −0
- typo3/sysext/backend/Resources/Public/JavaScript/tree/page-tree-element.js+1 −1
- typo3/sysext/backend/Tests/Functional/Controller/LiveSearchControllerTest.php+63 −0
- typo3/sysext/backend/Tests/Functional/Routing/Fixtures/PageTree.csvnew+11 −0
- typo3/sysext/backend/Tests/Functional/Routing/SiteUrlResolverTest.phpnew+155 −0
- typo3/sysext/backend/Tests/Functional/Tree/Repository/Fixtures/be_users_no_translated_search.csv+2 −1
- typo3/sysext/backend/Tests/Functional/Tree/Repository/Fixtures/FrontendUriPages.csvnew+3 −0
- typo3/sysext/backend/Tests/Functional/Tree/Repository/Fixtures/PageTree.csv+12 −12
- typo3/sysext/backend/Tests/Functional/Tree/Repository/PageTreeFilterTest.php+282 −5
- typo3/sysext/backend/Tests/Unit/Search/Event/ModifyConstraintsForLiveSearchEventTest.phpnew+174 −0
- typo3/sysext/core/Classes/Routing/SiteUrlResolver.php4new+97 −0
- typo3/sysext/core/Documentation/Changelog/14.2/Feature-105827-BackendSearchByPageURL.rstnew+72 −0
Review log 4662
Show 2737 earlier messages
-
Garvin Hicking uploaded patch set 1 12/18/24, 07:55
-
Garvin Hicking uploaded patch set 2 12/18/24, 07:57
-
core-ci voted on patch set 1 V +1 12/18/24, 08:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71342
-
core-ci voted on patch set 2 V +1 12/18/24, 08:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71343
-
Oli Bartsch commented on patch set 3
V +112/18/24, 08:12Published edit on patch set 2. -
core-ci voted on patch set 3 V +1 12/18/24, 08:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71344
-
Benni Mack commented on patch set 3 CR -1 03/27/25, 20:01
Comment removed by: Benni Mack; Reason: discussed otherwise -
Benni Mack commented on patch set 3 03/27/25, 20:07
SiteMatcher.php:142does not belong to SiteMatcher. It matches a page for a URL, not a site for a URL :) so... The chain is: - a new class, that uses site matcher, then page router... -
Garvin Hicking commented on patch set 3 CR -1 03/27/25, 20:15
SiteMatcher.php:142ReplyAck. please let me rework this patch as an eventlistener, also reworking this aspect. Then let's see if this is acceptable. I'd not like to provide this functionality as an extension because that would be fragile to maintain and people will likely not use it. the positive effect this search could have for editors is quite large in my opinion, because TYPO3 does not easily let you edit the exact page you're seeing in the frontend. I think the performance penalty only occurs when a "http(s)://" URI is entered as a search term. if you don't, nothing impactful will be performed. -
Garvin Hicking marked it work in progress 03/27/25, 20:15
-
Garvin Hicking uploaded patch set 4
CR -1V +107/07/25, 18:31 -
core-ci voted on patch set 4 V +1 07/07/25, 18:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81440
-
Garvin Hicking updated the commit message in patch set 5
V +107/07/25, 19:07 -
Garvin Hicking commented on patch set 5 07/07/25, 19:07
This change is ready for review.SiteMatcher.php:142ReplyDone -
core-ci voted on patch set 5 V +1 07/07/25, 19:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81441
-
Simon Schaufelberger commented on patch set 5 07/07/25, 23:30
SiteUrlResolver.php:31final : therefore can be Private -
Garvin Hicking commented on patch set 6
V +107/08/25, 05:18Published edit on patch set 5. -
core-ci voted on patch set 6 V +1 07/08/25, 05:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81458
-
Garvin Hicking commented on patch set 6 07/08/25, 06:11
SiteUrlResolver.php:31Replythx done and readonly'd. -
Simon Schaufelberger voted on patch set 6 CR +1 07/08/25, 08:31
-
Stefan Bürk commented on patch set 6 CR -1 07/08/25, 13:43
Reviewing / talking with Garvin ... -
Garvin Hicking commented on patch set 6 CR -1 07/30/25, 14:31
will iterate further.SiteUrlResolver.php:49Todo: Feedback from Stefan: Could be superflous? Use: ``` $pageArguments = $site->getRouter()->matchRequest($request, $previousResult); ``` instead of instantiating PageRouter on its own? Also check "isDirty" and further things. Comes from middleware `typo3/sysext/frontend/Classes/Middleware/PageResolver.php`. -
Garvin Hicking commented on patch set 6 07/30/25, 14:32
Add basic event listener test for the constraints event -
Garvin Hicking marked it work in progress 07/30/25, 14:32
-
Garvin Hicking commented on patch set 6 07/30/25, 14:47
ModifyConstraintsForLiveSearchEvent.php:48Only let the event implement "addConstraint", ensure type safety for it (use a single string|CompositeExpression): ``` public function addConstraints(string|CompositeExpression ...$constraints) public function addConstraint(string|CompositeExpression $constraint) ``` Explain why we don't want to modify the whole constraint setup (eventlisteners should not override everything, only add to it) ``` $constraints = [...array_values($coreConstraints), ...array_values($eventConstraints)]; ``` (or use foreach, whatever) -
Garvin Hicking uploaded patch set 7
CR +1V +112/11/25, 11:04 -
core-ci voted on patch set 7 V -1 12/11/25, 11:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92060
-
Garvin Hicking uploaded patch set 8
V -112/11/25, 11:30 -
core-ci voted on patch set 8 V +1 12/11/25, 11:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92063
-
Garvin Hicking commented on patch set 8 12/11/25, 11:45
This change is ready for review.Reply
DoneReply
DoneI've iterated on this, added tests, and implemented suggestions made by @stefan@buerk.tech I'd be happy for further feedback as I think this search functionality would be a very welcome thing for editors, and was recently brought up again on slack (https://typo3.slack.com/archives/C024TUMM7/p1765365904964569)ModifyConstraintsForLiveSearchEvent.php:48ReplyDoneSiteUrlResolver.php:49ReplyDone -
Garvin Hicking uploaded patch set 9
V +112/14/25, 18:31fix merge conflict -
core-ci voted on patch set 9 V +1 12/14/25, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92218
-
Georg Ringer voted on patch set 9 CR +1 V +1 12/18/25, 06:57
-
Guido Schmechel commented on patch set 9 V -1 12/19/25, 21:36
Currently, pages found in PageTreeFilter are not marked in orange because the TYPO3\CMS\Backend\Dto\Tree\Label is not set. What helped? Extend attachSearchResultLabel() with this query: if (str_starts_with($searchPhrase, 'http://';) || str_starts_with($searchPhrase, 'https://';)) { // If a search pattern uses "http(s)://...." then a frontend URL will be resolved. $resolvedPageUid = $this->siteUrlResolver->resolvePageUidBySiteUrl($searchPhrase); if ($resolvedPageUid === $page['uid']) { $matchedDirectly = true; } } Of course, you should keep an eye on performance here and not add to the for loop like I did ;-) Successfully tested: ‘https://t3main.ddev.site/unterseite’ finds the original page and a page with this URL in the title field. -
Garvin Hicking uploaded patch set 10
CR +1V +112/20/25, 12:33Use labels and add tests -
Garvin Hicking commented on patch set 10 12/20/25, 12:36
Reply
Thanks for the nudge. Indeed the "Page translation" thing changed a lot more that the patch did not yet cover. I now: - added tests for both the new intermediate helper class and the filter event - added attaching a label - added having a user TS config / setting to control if the event is used There's a bug that the clicking on the checkbox of the page tree filter to toggle the "frontend URI search" functionality is not updated in the UI. The checkbox for me does not get updated like "search by translation". I could not find how the JavaScript determines this UI state. @bo@cedev.de help? 😄 -
core-ci voted on patch set 10 V -1 12/20/25, 12:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92513
-
Garvin Hicking uploaded patch set 11
V -112/20/25, 12:53adjust namespace of test -
Garvin Hicking uploaded patch set 12 12/20/25, 13:02
juggle fixtures -
core-ci voted on patch set 11 V -1 12/20/25, 13:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92514
-
core-ci voted on patch set 12 V +1 12/20/25, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92515
-
Garvin Hicking uploaded patch set 13
V +101/14/26, 20:05 -
core-ci voted on patch set 13 V +1 01/14/26, 20:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93473
-
Guido Schmechel commented on patch set 13 CR +1 V +1 01/17/26, 13:07
My URL example now works too, and the page is marked in the backend. Thank you :-) -
Garvin Hicking uploaded patch set 14
CR +1V +101/20/26, 13:47 -
core-ci voted on patch set 14 V +1 01/20/26, 14:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93866
-
Josua Vogel uploaded patch set 15
V +101/22/26, 07:49 -
Josua Vogel voted on patch set 15 CR +1 V +1 01/22/26, 07:54
-
Garvin Hicking commented on patch set 15 01/22/26, 07:54
@j.vogel97@web.de Thanks so much for spotting my JS mistake!!!! <3 -
core-ci voted on patch set 15 V +1 01/22/26, 07:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94014
-
Josua Vogel voted on patch set 15 CR 0 V 0 01/22/26, 08:03
-
Josua Vogel commented on patch set 15 01/22/26, 08:08
Two enhancement suggestions: 1. When searching by translated URI, could we display the translated page in the results instead of the default language version? 2. For consistency with the title search, could we use "Found in translation: ..." as the page tree label for URI search results as well? -
Garvin Hicking commented on patch set 15 01/22/26, 08:35
Reply
1. I think this also does not happen for multilingual title search, the link always goes to the "parent" page. We could maybe address this in a folllwup? 2. The URI search will only find one page ever, since multiple pages cannot have the same URI. So I would argue such a tooltip would not help very much - and the code to attach labels is a bit complicated and requires extra listeners, so I intentioally left this out...? -
Garvin Hicking uploaded patch set 16
V +101/23/26, 17:36 -
core-ci voted on patch set 16 V +1 01/23/26, 17:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94192
-
Garvin Hicking commented on patch set 16 01/23/26, 17:49
Reply
Thanks for pointing me towards this. I've now refactored the code a bit: * Page tree receives a label for "found in uri translation: xxx" to distinguish pages found as a translation * Live search now shows both the specific language version of a link and its default page variant -
Georg Ringer voted on patch set 16 CR +1 V +1 01/23/26, 18:03
-
Simon Schaufelberger voted on patch set 16 CR +1 V +1 01/23/26, 18:54
-
Sven Liebert voted on patch set 16 CR +1 V +1 01/23/26, 20:14
-
Anja Leichsenring voted on patch set 16 CR +1 V +1 01/24/26, 05:06
-
Georg Ringer voted on patch set 16 CR +2 V +2 01/24/26, 05:47
-
Georg Ringer merged patch set 17 01/24/26, 05:47