Reviewed & tested by the community
Project:
Drupal core
Version:
main
Component:
search.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 May 2026 at 06:21 UTC
Updated:
14 May 2026 at 21:45 UTC
Jump to comment: Most recent
Comments
Comment #3
quietone commentedFix Drupal\Tests\search\Functional\GenericTest::testModuleGenericIssues. The error is related to routes but I am not sure what the proper fix is. Anyone?
Comment #4
quietone commentedAdding more detail for the error.
PHPUnit
browser output
The route search.view is used in search.links.menu.yml. It is setup in \Drupal\search\Routing\SearchPageRoutes::routes() but only if there there is a defined default search page. For some reason there is no default search page.
Comment #6
gábor hojtsyI researched this with LLM assistance.
The problem seems to be that
core/modules/user/src/Plugin/Search/UserSearch.phpattempts to extend theDrupal\search_user\Plugin\Search\SearchUserclass without requiring that module. I pushed a temporary attempt to conditionally define the class only if the base class is available (since the user module should not depend on thesearch_usermodule).Why is the
UserSearchplugin not in thesearch_usermodule?Comment #7
gábor hojtsyI see it is kept for BC. Is keeping the
UserSearchplugin in user module (where it is) an API?Comment #8
gábor hojtsyThe
search.viewproblem is that the route is defined as disabled by default. Thencore/modules/search/src/Routing/SearchPageRoutes.phpmakes it work if there was a default search provider. But in the test there is no search provider by default, so the link does not work in the help hook.I proposed a fix with conditional help text based on whether the route exists. I'm not sure the text is good now, that needs more review, but this passes the text for me locally.
(Analysis was LLM assisted).
Comment #9
gábor hojtsyOnly test that seems to fail is search update test not finding the dump file. The dump file is there though, and it passes fine locally even. I've also seen the same test pass on CI without modifying anything around it. However now it failed in several times in a row on CI. I am out of ideas on that. Why is this failing on CI and passing locally when it is about a location of a dump file?!
Comment #10
quietone commentedI did a bit of a tidy on the recent changes. I removed the getting the route provider only because I found it easier to read without separating out a part of a paragraph.
Adding a try/catch in hook help for the case when the route search.view doesn't exists works for this case. But what of the uses of the route in contrib?
Would it be better to go to a page with a message like 'no search pages available'?
Comment #11
gábor hojtsyMaybe for admins? I don't think its good for anonymous visitors to see a page with this. While there are many ways to fingerprint Drupal, I would generally avoid adding more such pages :)
Comment #12
smustgrave commentedSo only open question is if core/modules/user/src/Plugin/Search/UserSearch.php needs a CR or can point to the search module being deprecated.
Comment #13
smustgrave commentedTalked to catch and he mentioned a CR so I went ahead and added a simple one and added it inline to the MR. Rest LGTM.