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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: jedgar1mx commentedComment #5
jedgar1mx CreditAttribution: jedgar1mx commentedComment #6
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #7
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi 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 CreditAttribution: Pranali.addweb at AddWeb Solution Pvt. Ltd. commentedComment #9
Snehal Brahmbhatt CreditAttribution: Snehal Brahmbhatt at AddWeb Solution Pvt. Ltd. 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
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #12
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #13
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #15
DamienMcKennaComment #16
DamienMcKenna