Rework hook_menu_alter() for compatibility with other modules and less performance issues

Xano - June 17, 2009 - 17:33
Project:Vocabulary Index
Version:5.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Xano
Status:needs work
Description

This patch reworks hook_menu_alter() for compatibility wiht other modules using taxonomy/term/% like Taxonomy Breadcrumb. Using this path instead of taxonomy/term/[tid] also prevents performance issues with large browsable indexes.

AttachmentSize
hook_menu_alter_00.patch4.93 KB

#1

Xano - June 17, 2009 - 18:06

Code comment love.

AttachmentSize
hook_menu_alter_01.patch 4.96 KB

#2

aluminium - June 18, 2009 - 22:53

Breadcrumb start to work, but two items not.
1) Instead term title, e. g. "Drugs", it show "Taxonomy term"
2) Node not showing, "There are currently no terms in this vocabulary."
O_o

#3

Xano - June 18, 2009 - 22:56
Status:needs review» needs work

1) Good one. This is a bug I will fix tomorrow.
2) Where, how and what? This message should only be shown if you visit an index page for a vocabulary that contains no terms.

#4

aluminium - June 19, 2009 - 06:39

Thanks for help, Xano
For 2) Right, the message shown on every index page that contains no terms, but in that page i whant to see node with this term. I mean if you have some node with "term", you can't brouse for it becose it not shown on page for it "term"

#5

Xano - June 19, 2009 - 08:28

I'm not sure if I fully understand you. Index pages are the pages you define a path for at Administer > Site building Vocabulary Index. At those pages you will never ever see nodes, just terms or a message that says the vocabulary this page is for doesn't contain any terms. For browsable indexes Vocabulary Index overrides taxonomy/term/% for certain terms to display their child terms. If a term contains no other terms, you should see the default Taxonomy term page at those URLs, otherwise Vocabulary Index should list those terms.

#6

aluminium - June 19, 2009 - 12:58

Sorry, i made mistake, i did't enable taxonomy/term/% views. Now i do but have "access denied" and warning: array_merge() [function.array-merge]: Argument #2 is not an array in domain\sites\all\modules\taxonomy_breadcrumb\taxonomy_breadcrumb.module on line 104. messages.

#7

Xano - June 19, 2009 - 14:59

That's a bug in Taxonomy Breadcrumb, not in Vocabulary Index.

#8

aluminium - June 19, 2009 - 19:21

Ok, btw thanks a lot for your help.

#9

Defender - October 6, 2009 - 20:37

Tried to apply this patch, but TortoiseSVN tells me that
"Could not retrieve revision Jun 2009 19:54:16 -0000 1.1.2.5.2.83 of the file Z:\home\sessii.net\www\sites\all\modules\vocabindex\vocabindex.module.
Patching is not possible!"
:-(

#10

MGN - October 9, 2009 - 05:00
Status:needs work» needs review

I manually patched the latest dev version. Everything seems to work fine, but I haven't really done a thorough review. Still, I thought I'd attach an updated patch to help move this issue along.

AttachmentSize
494408_vocabindex_menu_alter.patch 7.82 KB

#11

Xano - October 11, 2009 - 20:26
Version:6.x-2.x-dev» 5.x-2.x-dev
Status:needs review» needs work

Committed to 6.x-2.x-dev. Ports to 5.x-2.x-dev and 7.x-2.x-dev will follow. The patch applies to 6.x-2.x-dev and is intended for future reference.

AttachmentSize
hook_menu_alter_02.patch 4.36 KB
 
 

Drupal is a registered trademark of Dries Buytaert.