Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After enabling the module on a site where Taxonomy module is not enabled, visiting 'admin/settings/menutrails' results a php error complaining:
Fatal error: Call to undefined function taxonomy_get_vocabularies()
Please check for the taxonomy.module with module_exists() or function_exists().
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#5 | menutrails.module_exists_taxonomy.patch | 2.79 KB | sigsby |
Comments
Comment #1
apadernotaxonomy.module is a core optional module; as alternative to verify if the module is enabled, Menu Trails could declare it as a dependency, if it needs taxonomy.module.
Comment #2
melon CreditAttribution: melon commentedI'm aware of the fact that taxonomy is a core module. But not depending upon it and then directly calling one of its' functions is clearly a bug.
I think it would be more elegant if it only checked the presence of the Taxonomy module and then built the admin settings form depending on the result of the check.
Comment #3
apadernoI was not saying it was not a bug, nor that you didn't know it is a core module.
My comment was for the maintainer(s) of the module, who maybe thought taxonomy.module is a core required module when it is not so.
Comment #4
lierbag CreditAttribution: lierbag commented+1
Menu Trails should have Taxonomy as a dependency. Even if you don't use Taxonomy, you have to enable it or else you get error messages like :
"warning: Invalid argument supplied for foreach() in /home/content/r/s/c/rscanlon/html/sites/all/modules/menutrails/menutrails.module on line 130."
Comment #5
sigsby CreditAttribution: sigsby commentedMaking it a dependency would be incorrect. This module does not depend on taxonomy. I have many sites where I don't have taxonomy enabled, and I personally don't want a module enabled I'm not using. Checking whether the module is enable is the correct approach. I did a search on taxonomy in the .module file and tried to fix all I could find, patch against 6.x-1.0 release is attached.
Comment #6
dan3h CreditAttribution: dan3h commentedBesides checking for the taxonomy module, we should also be asked whether or not we want menutrails even to be enabled with respect to the taxonomy module, for performance reasons on the admin page.
The reason for this is that, on our site, we have quite a few taxonomies, each with quite a few terms (several hundred all together), and for each term we have a couple-hundred menu enties to list. The result is that the menutrails admin page is prohibitively heavy to deal with: for us, it is a 14MB page, takes forever to load, takes forever for the browser to respond to mouse-events within it. And we had a memory-overflow problem on the server-side.
All we wanted was to use this module for the node-types functionality. We are incurring a huge performance hit for the taxonomy stuff, which we are not even using!
So, a simple checkbox for "operate with taxonomy module" would be great-- and then check that in conjunction with checking to see if that module is even enabled before running the taxonomy-related stuff.
Dan
Comment #7
eojthebraveIt looks like the the current 6.x-1.x-dev version already implements a check to see if taxonomy.module is enabled. Can you test with the latest dev version and see if you're still experiencing the same problems?
Comment #8
FiNeX CreditAttribution: FiNeX commentedThe -dev version fixed the problem.
Comment #9
eojthebraveMarking this as fixed as per #8.