hook_field_type_category_info_alter should not be in group field_purge

Created on 31 August 2025, about 1 month ago

Problem/Motivation

The API page https://api.drupal.org/api/drupal/core%21modules%21field%21field.purge.i... (Field API bulk data deletion) lists the unrelated hook (function) hook_field_type_category_info_alter.

When that hook was added to field.api.php, it was mistakenly placed before the close of the field_purge group.

Steps to reproduce

Look at the list of functions on the API page.

Proposed resolution

Move the function hook_field_type_category_info_alter (and its docblock) after the close of the group:

/**
 * @} End of "addtogroup field_purge".
 */

Remaining tasks

User interface changes

I am not sure this counts, but hook_field_type_category_info_alter will no longer be listed on https://api.drupal.org/api/drupal/core%21modules%21field%21field.purge.i....

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

N/A

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @benjifisher
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    Another fix would be to move the hook above the opening of the group:

    /**
     * @addtogroup field_purge
     * @{
     */
    

    In fact, it would be a good idea to reorganize all the hooks in field.api.php, but that would not be a Novice task. In the Proposed resolution, I recommend moving the hook after the close of the group for two reasons:

    1. It is the minimal change to fix the problem.
    2. If another issue adds a new hook to the end of the file, then that new hook will be outside the group.
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Good catch thanks! I agree this is novice with the scope in the issue summary.

  • First commit to issue fork.
  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    @luismagr please create the MR, i left instructive in this comment: https://www.drupal.org/project/drupal/issues/2943436#comment-16253399 πŸ“Œ Review all tests where system module is the only dependency Active

  • Pipeline finished with Canceled
    29 days ago
    Total: 69s
    #590830
  • Pipeline finished with Success
    29 days ago
    Total: 14093s
    #590652
  • πŸ‡ͺπŸ‡ΈSpain luismagr

    Tests passed now. I'd say this is ready for review

  • 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.

  • πŸ‡ͺπŸ‡ΈSpain luismagr

    Right, I'm not able to find how to fix what needs-review-queue-bot says. The txt file indicate there's a phpstan error on field.api.php however, I'm not able to run it locally. Running phpstan locally scan the src directory, the test and If I run it with -l 5 I can see field.module and field.purge.inc but not the field.api.php one.

    Any advice here would be great.

    Thanks

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    So when there is something like that is usually means a rule changed upstream.

    You need to rebase or update the fork to fix that, there are two ways to do this, one in the UI and one locally.

    In the UI:
    1. click on branch (not the MR) the link is called: 3544005-hookfieldtypecategoryinfoalter-should-not
    2. Click update fork on the right

    Locally:
    1. checkout 11.x from head
    2. git fetch
    3. git rebase
    4. Checkout this branch again
    5. git rebase 11.x

    Note that you will need to properly resolve conflicts if you rebase and is a bit beyond the scope of this issue so if you're not familiar with rebasing I would try the UI version and do some reading on rebasing.

  • πŸ‡ͺπŸ‡ΈSpain luismagr

    I've updated the brach using the UI. We'll see what the bot says now.

    Thanks again @nicxvan :)

  • 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.

  • πŸ‡ͺπŸ‡ΈSpain luismagr

    I did it using the UI. I normally merge instead of rebasing but if that's the workflow I'm ok to do it manually. In this case I didn't want toncomplicate things.

    I updated the branch with upstream and marked the issue as "needs review" but still got the same result. I can see it failed but there are no logs of what's exactly wrong.

    I'll try tomorrow again to see if I can replicate it locally

  • First commit to issue fork.
  • Pipeline finished with Failed
    26 days ago
    Total: 653s
    #592607
  • πŸ‡ͺπŸ‡ΈSpain luismagr

    Pipeline is failing. Needs to be checked

  • 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.

  • Pipeline finished with Failed
    25 days ago
    Total: 812s
    #593713
  • Pipeline finished with Failed
    15 days ago
    Total: 659s
    #603272
  • Pipeline finished with Success
    15 days ago
    Total: 694s
    #603437
Production build 0.71.5 2024