White page appears when I open for editing:
Main - Control - Structure - Types of materials - Material - EDIT
in eror.log:

PHP Fatal error: Call to a member function label() on a non-object in /.../public_html/modules/taxonomy_menu/src/Plugin/Menu/TaxonomyMenuMenuLink.php on line 81

Comments

fomenkoandrey created an issue. See original summary.

fomenkoandrey’s picture

Issue summary: View changes

Main - Control - Structure -- Menu
edit any menu link - the same error (((

UPD:
if i comment 81 line - admin panel works, but no taxonomy menu at my site

    return $this->entityManager->getStorage('taxonomy_term')->load($this->pluginDefinition['metadata']['taxonomy_term_id'])->label();
fomenkoandrey’s picture

How can i delete this module?
i try go to extentions/delete/ select and delet Taxonomy menu
clear cache.
but when i try edit any menu - i have error
Drupal\Component\Plugin\Exception\PluginException: Plugin (taxonomy_menu.menu_link:taxonomy_menu.menu_link.countries.17) instance class "Drupal\taxonomy_menu\Plugin\Menu\TaxonomyMenuMenuLink" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 102 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

nerdstein’s picture

Can you please provide some more details?

- What version of Drupal 8 are you using?
- Under what pre-conditions? (e.g. A menu has content, a taxonomy vocabulary has terms)
- What are the steps to reproduce?

nerdstein’s picture

Please note, I have been testing this on RC4 and I do not seem to be having experiencing issues.

nerdstein’s picture

Assigned: Unassigned » nerdstein
usrsbn’s picture

I get the same error message using Drupal 8.0.0, Taxonomy Menu 8.x-3.1
Created taxonomy menu from vocabulary, deleted single term from vocabulary, disabled corresponding taxonomy menu link.

When uninstalling module and cache rebuild, after trying to edit my menus, I get the same error as above.

usrsbn’s picture

More info:
I tried to delete my primary links menu -> error
I deleted the menu entry (taxonomy_menu.menu_link: [...]) from table menu_tree -> drush cr -> I can edit my other menus again.

usrsbn’s picture

I just reproduced this using Drupal 8.0.1.
Step 1: Created taxonomy menu from vocabulary
Step 2: Added taxonomy menu block to region
Step 3: Deleted one term of vocabulary
Step 4: Trying to edit menu via admin/structure/menu produces error

Fatal error: Call to a member function label() on null in /modules/taxonomy_menu/src/Plugin/Menu/TaxonomyMenuMenuLink.php on line 81

But:
Step 5: Now I can delete the menu
Step 6: After that I can delete the taxonomy menu without producing error no.2

nerdstein’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB

The following patch fixes the error but demonstrates a larger problem in which stale links exists in the associated menu when you remove a taxonomy term.

Submitting this for review. I'll create a new issue for the stale menu items. When you delete a term, the subsequent menu item should be deleted as well.

nerdstein’s picture

Not resolved with a cache clear either.

nerdstein’s picture

This patch is comprehensive. Fixes the error and removes links from menus when taxonomy terms are deleted.

Please test, needs reviewed.

VBN’s picture

StatusFileSize
new25.02 KB

After the patch provided in #12, the fatal error goes away.
But when i look at the place where i created the taxonomy menu, there are now Blanco menu links.
Unable to delete...
blanco menu items
When i want to edit, it says:
This link is provided by the Taxonomy Menu module. The title and path cannot be edited.

nerdstein’s picture

Did you try with a fresh instance? I was not able to reproduce with a brand new taxonomy menu entity (menu / taxonomy vocab). The issue you mentioned would occur on your existing setup.

VBN’s picture

yes, it was indeed a fresh install v8.0.2

nerdstein’s picture

I'll take another look and prep a patch, thanks.

nerdstein’s picture

@VBN, I have tested this thoroughly and cannot reproduce it. I exhibited this behavior when I had deleted terms from a vocabulary to an existing Taxonomy Menu entity.

Please try this:
1. Add a new menu
2. Add a new vocabulary, add terms
3. Create a new taxonomy menu with the new vocab and menu
4. Remove terms

Following those steps above, there are no blank menu items. If you are using an existing menu that has already been broken, it will likely need to be rebuilt. The patch *does not* clean up old links.

killua99’s picture

Status: Needs review » Needs work

I'm having the same result as @VBN I'm not able to delete old taxonomy menu, They're white and cannot be deleted.

But patch #12 solve the bug with the callback and label thing.

VBN’s picture

@nerdstein, maybe that is the difference.
I used terms that already existed in my taxonomy, before I added the menu.
Those were just some random terms I added to experience.

After removing this menu and menu module the Blanco's remain.
For the moment i will not reinstall Taxonomy Menu, I decided to manually create links to my menu.

Thank you for looking further into this case,
I'll reinstall the module soon.

Anonymous’s picture

I stuck with the orginal problem and the patch do not work. When I try to uninstall the module I get error message when I am trying to edit a content type or creating a new one:

Drupal\Component\Plugin\Exception\PluginException: Plugin (taxonomy_menu.menu_link:taxonomy_menu.menu_link.moment.88) instance class "Drupal\taxonomy_menu\Plugin\Menu\TaxonomyMenuMenuLink" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 102 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

If I install the module again I am back at the former error message...
Stuck here.

hansfn’s picture

I got a similar error:

PHP Fatal error:  Call to a member function getDescription() on null in .../modules/taxonomy_menu/src/Plugin/Menu/TaxonomyMenuMenuLink.php on line 88

The patch in #12 removed the fatal error.

nerdstein’s picture

Status: Needs work » Needs review
StatusFileSize
new4.12 KB

I have uploaded one more patch that brings in all of the recent commits from 8.x-3.x.

Just a reminder that all taxonomy menus needs to be deleted and rebuilt for this patch to work properly.

I have again retested all of this and it works just fine with new taxonomy menus. I apologize about having to delete existing taxonomy menus, but it has been resolved now as best as I can tell.

nerdstein’s picture

Status: Needs review » Fixed

I have merged this into 8.x-3.x because I want to get this in the next release.

I'll address any further changes within this issue and additional patches.

  • nerdstein committed 6773049 on 8.x-3.x
    Issue #2588411 by nerdstein: PHP Fatal error: Call to a member function...

Status: Fixed » Closed (fixed)

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