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

Issue fork drupal-3544005

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

benjifisher created an issue. See original summary.

benjifisher’s picture

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.
nicxvan’s picture

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

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

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

nicxvan’s picture

@luismagr please create the MR, i left instructive in this comment: https://www.drupal.org/project/drupal/issues/2943436#comment-16253399

luismagr’s picture

Status: Active » Needs work
luismagr’s picture

Status: Needs work » Needs review
luismagr’s picture

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

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new664 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.

luismagr’s picture

Right, I'm not able to find how to fix what needs-review-queue-bot says. The txt file indicates that 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 tests 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

nicxvan’s picture

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.

luismagr’s picture

Status: Needs work » Needs review

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

Thanks again @nicxvan :)

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new664 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.

luismagr’s picture

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

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

luismagr’s picture

Status: Needs work » Needs review
luismagr’s picture

Status: Needs review » Needs work

Pipeline is failing. Needs to be checked

luismagr’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new664 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.

luismagr changed the visibility of the branch 11.x to hidden.

luismagr’s picture

Status: Needs work » Needs review

luismagr changed the visibility of the branch 3544005-hookfieldtypecategoryinfoalter-should-not to hidden.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new664 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.

luismagr’s picture

I think I give up. I have no clue about how to fix this issue :(

Any help?

nicxvan’s picture

Happy to help here!
Here is how I fixed it.

Ensure my local 11.x is up to date

git checkout 11.x
git fetch
git rebase

Get this fork

git remote add drupal-3544005 git@git.drupal.org:issue/drupal-3544005.git
git fetch drupal-3544005
git checkout -b '3544005-hookfieldtypecategoryinfoalter' --track drupal-3544005/'3544005-hookfieldtypecategoryinfoalter'

Update this fork
git rebase 11.x

Run phpcs on the file
composer phpcs core/modules/field/field.api.php

Safely push with lease
git push drupal-3544005 --force-with-lease

nicxvan’s picture

Status: Needs work » Needs review

Let's see if the bot complains about this. The tests should run now.

luismagr’s picture

Ok, I updated my local and rebase as well. I guess I missed some step. Anyway, I'll note down this advise.

Thanks for the info. Let see if it's ok now.

nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

I think this is ready!

Normally you can't RTBC when you work on it without peer review, but my contribution here beyond advice was just a rebase and this is a super simple change I think it's fine to RTBC here.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new664 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.

nicxvan’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: +no-needs-review-bot

I think this is due to no code changes and just documents.

luismagr’s picture

It's really weird bit I'm glad to see that is nothing on my side :)

What you said makes sense so if there's a way to test that the final documentation is correctly generated that would be enough but if not, maybe we can cherry-pick the commit in a branch with some code modification on it

I'm not expert in contributing so I'm not sure how to proceed

Thanks for the help

quietone’s picture

@nicxvan, thanks for providing instructions on this novice issue!

Another think one can do locally is to run the same checks locally that are run before a commit. That is all in the script, ./core/scripts/dev/commit-code-check.sh.

  • quietone committed af7c1723 on 11.x
    Issue #3544005 by benjifisher, nicxvan, luismagr:...

  • quietone committed e5e5bbb3 on 11.2.x
    Issue #3544005 by benjifisher, nicxvan, luismagr:...
quietone’s picture

Committed af7c172 and pushed to 11.x and cherry-picked to 11.2.x Thanks!

quietone’s picture

Version: 11.x-dev » 11.2.x-dev
Status: Reviewed & tested by the community » Fixed

Also, the API docs are generated using the API project. One can test changes by
creating a local API site.

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

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

Maintainers, please credit people who helped resolve this issue.

benjifisher’s picture

@nicxvan, thanks for providing instructions on this novice issue!

I just want to add my thanks, too, since I am the one who created the issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.