There is a problem when Taxonomy Manager and Taxonomy Breadcrumb are both installed. Attempt to taxonomy pages fails with error:
PHP Fatal error: Call to undefined function taxonomy_term_page() in ... on line 234. This issue is quite old and was reported in http://drupal.org/node/358411. I've noticed that there is a conflict between two functions: _taxonomy_breadcrumb_term_page() and taxonomy_manager_term_page(). I've made some modifications in taxonomy_breadcrumb files. I've also found bug in install file - installation taxonomy_breadcrumb module on clean system doesn't modify weight in {system} table, which is necessary to proper work. First, patch the files and then reinstall taxonomy_breadcrumb module (uninstall and install again or use 'reinstall module' in devel menu).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MGN’s picture

Status: Needs review » Closed (won't fix)

Thanks,

I'll correct the install file.

I suspect that taxonomy_manager is incorrectly disabling (or inappropriately over-riding) a core taxonomy function. A call to taxonomy_term_page() should never fail, since its part of taxonomy. My guess is that if you are seeing this with taxonomy_breadcrumb, you would also see it with any other module that calls this core function.

So this is not a conflict between taxonomy breadcrumb and taxonomy manager - taxonomy breadcrumb is calling taxonomy_term_page, a core function that must be available if taxonomy is installed. Since the error only appears with taxonomy_manager installed (I can't replicate the problem that you describe on a clean install of taxonomy breadcrumb without taxonomy_manager), I would suggest patching taxonomy_manger to fix this problem.

I am 99% certain that the use of hook_menu is appropriate to override the core taxonomy_term page, but I'll look into it further. If there is anything inappropriate about the way taxonomy_breadcrumb is doing it, I'll fix it.

At this point, while your patches may fix your problem, it isn't appropriate to commit them to taxonomy_breadcrumb. I am marking this as won't fix (though I will fix the install file).

I hope this makes sense to you. Your effort is appreciated!

ergophobe’s picture

MGN

I think you're right. If you look at my comment in the Taxon Man thread, disabling Tax Bread worked at first, but then the same problem came back up as I installed other taxonomy modules. So my conclusion was that it's a Taxon Manager issue.

I've never had a problem with Taxomony Breadcrumb conflicting with anything if Taxonomy Manager. I realize that's just sort of circumstantial, but there it is.

mh86’s picture

The Taxonomy Manager does not override the function taxonomy_term_page(), the module is using hook_menu_alter to change the menu callback function to its own callback.
The function taxonomy_term_page() is located in taxonomy.pages.inc. So it might happen, that with an inproper call of this function the file taxonomy.pages.inc is not included and this would lead to an call to undefined function error.
In my opinion it would be better to implement hook_menu_alter in taxonomy_breadcrumb. This might solve the conflict.

kndr’s picture

Status: Closed (won't fix) » Active

Both modules, Taxonomy Manager and Taxonomy Breadcrumb, override function taxonomy_term_page(). This is a source of problem. Taxonomy Breadcrumb do it less elegant - look at my tm_tb_module.patch. I think, hook_menu_alter should be used to do it (like Taxonomy Manager do). What will you do with this overriding problem? In my opinion - you have two ways: tell "it's not my problem" or try to solving this (maybe with TM developer, I don't know). It can be fix. It depends of your will.

MGN’s picture

I agree it can be addressed, and its always been my intention to do so. As I indicated above, my assumption was that hook_menu was the correct way to override the core taxonomy_term page. But you are claiming that hook_menu_alter is the correct way. Its important to figure out which is correct, so you don't have to go through this with every module that calls taxonomy_term_page(), as rick_deckard has described. Its time to seek some wise council. I'll keep seeking advice and hopefull will have this resolved soon. Thanks for bringing this issue forward.

mh86’s picture

hook_menu_alter was introduced in Drupal 6 and should be used when you want to change existing menu items.here you can find further information in the docu pages.

Implementing it with this hook should at least prevent the php error, but there is still a conflict, only one function can return the output for the term page, either by taxonomy breadcrumb or taxonomy manager (in case of merged terms). This will be regulated by module weights. In my opinion, the implementation of taxonomy breadcrumb is much more important than the one of taxonomy manager.

MGN’s picture

FileSize
3.65 KB

Thanks again for your help on this. Rather than build in a specific dependency on the Taxonomy Manager module, I've developed a more general solution that should allow taxonomy_breadcrumb to coexist with any other module that also overrides the core taxonomy callback. Before overriding, the existing callback is stored. _taxonomy_breadcrumb_term_page() then uses this to return the output of the original callback function, rather than defaulting to the core taxonomy term page. This should work provided the taxonomy breadcrumb module has the greatest weight (so taxonomy_breadcrumb_menu_alter is called last), and the existing callback uses the same parameters (and in the same order) as the core taxonomy_term_page function. This seems to be a safe assumption.

@mh86: Does this approach to avoiding the conflicts seem appropriate ? Do you see any problems with it?

@kndr: Can you test this patch and see if it prevents the conflict for you ?

kndr’s picture

Nice solution. #7 works for me. It prevents the conflict with Taxonomy Manager. Thanks.

MGN’s picture

Status: Active » Fixed

Thanks, I just committed the fix to 6.x-1.x-dev. It also solved the (possibly related) problem #433020: Deletes menu items.

lentreprenaute’s picture

I downloaded the lasted version of taxonomy manager.I had this error since i used taxonomy manager for deleting some terms. before all was right.

Fatal error: Call to undefined function taxonomy_term_page() in F:\wwwroot\htdocs\lweb\modules\taxonomy_manager\taxonomy_manager.module on line 234

Status: Fixed » Closed (fixed)

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