I have a site with a deeply nested vocabulary of some 7000 terms. We want to make a menu for the first two levels of that tree, since a menu that large causes Drupal to use more than my current memory_limit (512M), even if the levels below the two first ones are never displayed.
I am working on a patch for this, so I'll post it here when ready.
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | taxonomy_menu-max_depth-990512-29.patch | 3.17 KB | aby v a |
| #28 | interdiff-990512-27-28.txt | 401 bytes | aby v a |
| #27 | taxonomy_menu-max_depth-990512-27.patch | 3.17 KB | alex.bukach |
| #24 | maxdepth-990512-24.patch | 3.33 KB | jmoughon |
Comments
Comment #1
miklHere’s the patch, seems to work as advertised :)
Comment #2
benone commented+1
waiting until comitted
Comment #3
dstolhttp://drupal.org/cvs?commit=487776
Thanks!
Comment #5
camdarley commentedPort to D7 for this usefull feature.
Comment #6
camdarley commentedPrevious patch didn't update the taxonomy_menu table. This one does.
Comment #8
camdarley commented#6: Depthlimit-990512.patch queued for re-testing.
Comment #10
gianfrasoft commentedcamdarley, do you think you will correct that patch?
Thanks.
Comment #11
gianfrasoft commentedHowever I applied patch at #6 and it seems it works perfectly.
Many thanks!
Comment #12
dstol#6: Depthlimit-990512.patch queued for re-testing.
Comment #14
k.skarlatos commentedits working for us too (latest core and taxonomy menu)
Comment #15
hles commentedNeeds to be ported to 7.x-2.x, needs tests.
Comment #16
keenubee commentedPlease test another patch :)
Comment #17
keenubee commentedNot correct status in previous comment.
Comment #18
johnvIMO the root cause is the fact that the menu system (unnecessarily) loads every object in the menu.
#1973920-7: Memory/Performance problems, when building a menu with a large taxonomy_menu
Comment #19
Grayside commented#17 appears to work for me.
Comment #20
jmoughon commentedI have implemented and tested the patch in #17. Recommend adding it to dev.
Comment #21
jamestombs commentedThe patch in #17 is fine when you save the menu from the vocabulary page but if you have synchronisation enabled and a term gets updated the full vocabulary is built ignoring the max depth.
Comment #22
jmoughon commentedI also ran into the same problem @ jamestamr. Updated patch. Checks for term depth and max depth setting and makes sure the depth setting is greater than or equal to the term depth or that the term depth is not set.
Comment #23
sovarn commented#22 introduces a function called
term_depth(). However there is no function called term_depth so it causes an error.Comment #24
jmoughon commentedGood catch. I have updated the patch to add a helper function to the database.inc.
Comment #25
kenorb commentedComment #27
alex.bukach commentedRe-rolled and updated the path against current 7.x-1.x head.
Comment #28
aby v a commentedHi,
I have corrected some coding standard problems.
Comment #29
alex.bukach commentedRight aby v a, will you post the whole patch?
Comment #30
aby v a commentedHi Alex Bukach,
I have updated the whole patch. Kindly check it.
Comment #31
brayfe commentedTested the patch in #30 and it does the trick for me. Using Drupal 7.50, Taxonomy Menu 7.x-1.5, and trying to only show parent items of a hierarchical taxonomy. Works like a charm with Max Depth set to 1.
Comment #32
sibopa commentedThanks guys.
#30 worked for me as well.
Comment #34
dstolThanks, committed to 7.x-1.x.