Problem/Motivation

@joachim noted that various api.php files mention search. These are the ones I found:

theme.api.php — 6 references, all in documentation examples:

  • Lines 51-77: Uses search_result as the example theme hook for hook_theme() — the whole code block example
  • Lines 96-97: "to override the display of search results, a theme would add search-result.html.twig"
  • Lines 142-155: Uses item_list__search_results as the example for __SUGGESTION syntax, and explains search_theme_suggestions_search_result()
  • Lines 1222-1223: Uses search_result as the example for how template names are derived

entity.api.php — 2 areas:

  • Lines 318-325: Bullet list in "Other entity hooks" section listing hook_node_search_ranking(), hook_node_search_result(), "Search indexing nodes"
  • Lines 1819-1820: hook_entity_view_display_alter example code uses search_index view mode — should use a different view mode to explain

node.api.php — 3 search-specific hooks documented: hook_node_search_result(), hook_node_update_index(), hook_node_search_ranking() — these are defined by the search_node submodule, so they belong there

toolbar.api.php — the hook_toolbar() example just happens to add a generic HTML field to the toolbar, and 'library' => ['search/global'] — that's a hypothetical custom search/global library, not the search module. This is fine as-is.

core.api.php — references to the search plugin system in the plugin architecture docs (lines 1321, 1351, 1406-1407) — these are part of explaining the plugin system using search as an example.

Steps to reproduce

Proposed resolution

Remove/move/update search mentions in api.php files

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

LLM disclosure

LLM was used to detail the findings and to resolve them. With human review.

Issue fork drupal-3614996

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gábor hojtsy created an issue. See original summary.

gábor hojtsy’s picture

Issue summary: View changes
Status: Active » Needs review

Proposed MR.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new549 bytes

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community

Bot you are wrong! MR seems fine to me. Good replacements, going to go on a limb and mark.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new549 bytes

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

gábor hojtsy’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community

Fix misstated result in issue summary, does not change RTCB status though :)

gábor hojtsy’s picture

Issue tags: +no-needs-review-bot
smustgrave’s picture

don't know why the bot is picking on this issue.

quietone’s picture

@smustgrave, if the bot is running commit-code-check.sh, the PHPStan check always fails when the only files changes are *.api.php, as is done in this issue.

smustgrave’s picture

Never knew that. Learn something new everyday!

larowlan’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to main, doesn't apply cleanly to 11.x - setting at Patch (to be ported)

quietone’s picture

Actually, I don't think this should be backported because Search will still be in 11.x where this documentation will be valid.

gábor hojtsy’s picture

I think it does not hurt to leave 11.5 as-is, although if other docs things are backported that would be make it easier if this is backported too first.

That said I think most of the updates are just different examples for implementing hooks, so either search or other things as in the MR are valid examples. Also the search node moved hooks would also be valid in the search node submodule now in Drupal 11.

The main thing that would be lost is the 12 lines of "other entity hooks" which is the first hunk in the MR, I can see the clear reason not to backport that one hunk :)

  • larowlan committed 8aa44535 on main
    task: #3614996 Remove/move/update search mentions in api.php files
    
    By:...
larowlan’s picture

Version: 11.x-dev » main
Status: Patch (to be ported) » Fixed

Thanks for pointing out that I didn't push this one @quietone

Have done so now.

Marking as fixed as we don't want to backport per the above.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.