I installed `taxonomy_menu` and added a some vocabularies to the main navigation. But then i started to get this error
The website encountered an unexpected error. Please try again later.
Error: Call to a member function getDescriptionFieldName() on null in Drupal\taxonomy_menu\Plugin\Menu\TaxonomyMenuMenuLink->getDescription() (line 119 of modules/contrib/taxonomy_menu/src/Plugin/Menu/TaxonomyMenuMenuLink.php).
I tried deleting the menu links on the main navigation in the database but now i get this error.
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Component\Plugin\Exception\PluginException</em>: Plugin (taxonomy_menu.menu_link:taxonomy_menu.menu_link.government.1641) instance class "Drupal\taxonomy_menu\Plugin\Menu\TaxonomyMenuMenuLink" does not exist. in <em class="placeholder">Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass()</em> (line <em class="placeholder">97</em> of <em class="placeholder">core\lib\Drupal\Component\Plugin\Factory\DefaultFactory.php</em>).
Not sure if clearing the main navigation would be the solution or something with the `taxonomy_menu` module.
Any assistance is very appreciated, thanks in advance.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | taxonomy_menu-3006108-8.patch | 762 bytes | Snehal Brahmbhatt |
| #4 | 3006108-check-taxonomy-menu-null.patch | 879 bytes | jedgar1mx |
Comments
Comment #2
jedgar1mx commentedI forgot to add that the main site menu can't not be edit manually anymore and the second error comes when i do a site search.
Comment #3
jedgar1mx commentedSeems that taxonomy_menu plugin still tries to get the description of deleted items.
I fixed it by replacing line 119 on modules/contrib/taxonomy_menu/src/Plugin/Menu/TaxonomyMenuMenuLink.php
$description_field_name = $taxonomy_menu->getDescriptionFieldName();With:
Comment #4
jedgar1mx commentedComment #5
jedgar1mx commentedComment #6
andrtroe commentedComment #7
andrtroe commentedAs I see $description_field_name variable is used below, so if your patch is applied there will be notice of undefined variable.
Comment #8
pranali.addweb commentedComment #9
Snehal Brahmbhatt commented@jedgar1mx @andrey.troeglazov, I have changed code to resolve "getDescriptionFieldName() null" and "undefined $description_field_name variable" issue. Kindly review my patch, hope this will work for you!..
Thanks!..
Comment #10
andrtroe commentedComment #12
andrtroe commentedComment #13
andrtroe commentedComment #15
damienmckennaComment #16
damienmckenna