Steps to reproduce:

  1. Enable taxonomy_term view
  2. Edit taxonomy_term argument and validate it only in select vocabularies. E.g., Fail validation for "Vocabulary A"
  3. Edit a term in "Vocabulary A"

Result: The following php notice appears:

Notice: Undefined index: href in menu_local_tasks() (line 2070 of /home/.../includes/menu.inc)

I traced it as much as I can and I understand that this notice happens when the menu is building local tasks for taxonomy/term/%/edit. One of the local tasks is taxonomy/term/% and since the argument is failing validation, the logic does not proceed in providing 'href'. Thus, the notice appears.

Comments

akosipax created an issue. See original summary.

akosipax’s picture

I read this comment #1322176-13: Undefined index: href in menu_local_tasks() and the user sounds like he is having a very similar issue. However, i want to avoid the solution he suggested since installing another modules seems to add unnecessary complexity. My enabled taxonomy terms are always displayed consistently and I just want to disable certain ones.

I checked how the node module does this with their unpublished nodes. When building local tasks of node/%/edit, node_load (which is called in _menu_load_objects()) would still return a node object for the local task node/% and proceed with setting the 'href'; They handle access logic using their access_callback.

For taxonomy/term/%/edit on the other hand, views_arg_load() will not return an object since it fails validation and the site will not proceed in setting an href.

There must be a reason why we are not using an access callback to handle access logic and it seems like it would really affect a few things if we are to change how views_arg_load works. But I'm leaving this here in case someone more knowledgeable with views will find that it makes sense to change views_arg_load()

renatog’s picture

Category: Task » Support request
Status: Active » Fixed

Hello akosipax! Thanks a lot to put it here. I cleared all logs on watchdog and I followed all steps using taxonomy_term, and it worked without errors or warning dblogs. The only step that I did to solve was upgrade the project before. P.s. I tested local using Lando, and in my webserver running Acquia and other using Platform.sh. So to solve that please do this as well, upgrade your views to the last stable version that now is 7.x-3.24, if you can I recommend upgrade the ctools as well 7.x-1.19 and the Drupal I used the last one, so if you can is recommended to upgrade to 7.81. After that just run all pending updates on /update.php and clear caches with drush cc all. After that you can clear you watchdog and see that it'll be fixed now. Even so, if you have any other issue feel free to reopen ok? Thank you so much akosipax

Status: Fixed » Closed (fixed)

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