Problem/Motivation

There are references to template_preprocess_form_element() in comments. This function is now an initial preprocess callback.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3612551

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

joachim created an issue. See original summary.

charlliequadros made their first commit to this issue’s fork.

charlliequadros’s picture

Status: Active » Needs review
charlliequadros’s picture

Hi @joachim

I've made the change. Please let me know if anything else is needed.

nicxvan’s picture

Thanks for finding these!

We should probably search for any remaining template_preprocess comments and convert the comments in one go.

No more template preprocess functions exist except a test maybe.

Also I know this is pedantic, but I do not think I would call this a hook anymore, it is just an initial preprocess callback now.

marcoscano made their first commit to this issue’s fork.

marcoscano’s picture

Issue summary: View changes

I agree it makes sense to fix all occurrences in one go, as suggested in #6.

I used LLM to perform a global search and fix. Updated the MR with the occurrences found, after reviewing them.

A few judgement calls the LLM made worth reviewing by us:

  - block--navigation.html.twig referenced template_preprocess_navigation_block(), which never existed post-conversion; the hook is registered with 'base hook' => 'block', so it now points to \Drupal\block\Hook\BlockHooks::preprocessBlock().
  - default_admin's filter-guidelines.html.twig pointed at the wrong hook's preprocess (filter_tips); it now points to FilterThemeHooks::preprocessFilterGuidelines().
  - Two @see lines were removed rather than replaced, because filter_tips and status_report have no initial preprocess at all — mirroring their base templates, which carry no @see.
  - block-content-add-list.html.twig now points to the theme's own PreprocessHooks::preprocessBlockContentAddList() — the only code anywhere that provides its variables.
  - Three base templates had wrong FQCNs (missing the Hook\ segment; media's also lacked ()): media.html.twig, toolbar.html.twig, filter-guidelines.html.twig. Fixed.
  - theme.api.php:1362 referenced the removed procedural user_template_preprocess_default_variables_alter(); it now cites UserHooks::templatePreprocessDefaultVariablesAlter().

And then a suggested follow-up:

`default_admin` has a `block_content_add_list` template and preprocess hook, but that theme hook is no longer registered anywhere in core — likely dead code from the Gin port, worth its own issue.

I have also adjusted the terminology in the IS ;)

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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.

joachim’s picture

I'm unsubscribing. I refuse to work on MRs where LLMs have been used. LLMs are accelerating climate change.