- 🇫🇷France aiphes
With
Custom Search (custom_search) Enabled 8.x-1.0-beta9
, suggestion disappear.
Do I need to repatch ? - Status changed to Needs work
over 1 year ago 2:59pm 21 April 2023 - 🇩🇪Germany guido_s Cologne
Patch #15 doesn't apply to beta-9 and search-result.html.twig in my theme won't get used although it's the suggested file name.
So the patch needs at least a reroll. - Status changed to Needs review
over 1 year ago 12:49pm 24 April 2023 - 🇩🇪Germany guido_s Cologne
I rerolled the patch from #15 and resolved merge conflicts in the rebase process which occurred in the custom_search_theme_registry_alter() function. Those conflicts were a result from replaced deprecated functions.
So I removed the lines just like patch #15 did.The rerolled patch should apply to 8.x-1.0-beta9
- 🇫🇷France aiphes
Thanks to #19. It works for the beta9.
Search Custom Search (custom_search) Enabled 8.x-1.0-beta9
modules/contrib/custom_search$ curl https://www.drupal.org/files/issues/2023-04-24/custom_search-2885485-19.patch | git apply % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 18063 100 18063 0 0 42601 0 --:--:-- --:--:-- --:--:-- 42601
- Status changed to Needs work
about 1 year ago 2:50pm 20 October 2023 - 🇫🇷France cedric_a France
I just tested the patch #19 on a fresh Drupal 10.1.5 with Custom Search 8.x-1.0-beta9 and I could override the template custom-search-result.html.twig by copying it from the module folder to my custom theme folder.
However, the twig debug is showing this error message in the markup :<!-- THEME DEBUG --> <!-- THEME HOOK: 'search_result' --> <!-- FILE NAME SUGGESTIONS: * search-result--node-search.html.twig * search-result.html.twig --> <!-- INVALID FILE NAME SUGGESTIONS: See https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api.php/function/hook_theme_suggestions_alter custom_search_result__node_search custom_search_result --> <!-- BEGIN OUTPUT from 'themes/thematik/templates/custom-search-result.html.twig' --> [...] <!-- END OUTPUT from 'themes/thematik/templates/custom-search-result.html.twig' -->
So I looked at the api doc mentionned and spoted this :
New suggestions must begin with the value of HOOK, followed by two underscores to be discoverable.
I tested to change the suggestions from "custom_search_result__" to "search_result__", it removes the warning and show the template used with an "x".
But I think that it's not the suggestion name that we want because it is the name of the core search result template.
Should we adopt a suggestion name like "search_result__custom_search__" ?
I'm wondering if these changes will break backward compatibility too.