Problem/Motivation

In core/lib/Drupal/Core/Menu/menu.api.php:

 * Local tasks from other modules can be altered using
 * hook_menu_local_tasks_alter().

This is wrong. hook_menu_local_tasks_alter() is for altering tasks pre-render. It's called at display time, not during discovery.

The discovery alter hook is hook_local_tasks_alter().

Steps to reproduce

Proposed resolution

Fix the docs.

Add a mention of hook_menu_local_tasks_alter(), to say this alters local tasks displayed on the page before they are rendered.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3462100

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.

Prem Suthar made their first commit to this issue’s fork.

prem suthar’s picture

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

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

prem suthar’s picture

Status: Needs work » Needs review
joachim’s picture

Status: Needs review » Needs work

Good start.

But we should keep the mention of hook_menu_local_tasks_alter().

Something like:

> Additionally, hook_menu_local_tasks_alter() can be used to alter local tasks dynamically before they are rendered.

prem suthar’s picture

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

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

prem suthar’s picture

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

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

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

arunkumark’s picture

Status: Needs work » Needs review

Back merged the 11.x core to the branch to resolve the Queue bot merge issue.

Moving to NR

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Okay so this issue was created and tagged novice on the 17th. Novice issue are meant for new users

@Prem Suthar you picked it up less then 2 days later, and as mentioned before in several tickets your post history shows you can avoid novice issues in the future

@arunkumark same deal

Both please try to avoid novice issues unless they've sat there for a few weeks, which wasn't the case here.

Believe @joachim feedback was addressed though

  • nod_ committed 71bcc296 on 10.4.x
    Issue #3462100 by Prem Suthar, arunkumark, joachim, smustgrave: Menu...

  • nod_ committed 9678dc64 on 11.x
    Issue #3462100 by Prem Suthar, arunkumark, joachim, smustgrave: Menu...
nod_’s picture

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

Committed and pushed 9678dc6468 to 11.x and 71bcc296f5 to 10.4.x. Thanks!

Status: Fixed » Closed (fixed)

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