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.

CommentFileSizeAuthor
#5 menutrails.module_exists_taxonomy.patch2.79 KBsigsby
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

apaderno’s picture

taxonomy.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.

melon’s picture

I'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.

apaderno’s picture

Title: Module doesn't check for taxonomy module. » Module doesn't check for taxonomy.module

I'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 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.

lierbag’s picture

+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."

sigsby’s picture

Making 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.

dan3h’s picture

Besides 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

eojthebrave’s picture

It 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?

FiNeX’s picture

The -dev version fixed the problem.

eojthebrave’s picture

Status: Active » Fixed

Marking this as fixed as per #8.

Status: Fixed » Closed (fixed)

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