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.

Comments

mikl’s picture

Assigned: mikl » Unassigned
Status: Active » Needs review
StatusFileSize
new3.05 KB

Here’s the patch, seems to work as advertised :)

benone’s picture

+1
waiting until comitted

dstol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

camdarley’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Component: Sync or Update Issues » Sync
Status: Closed (fixed) » Needs review
StatusFileSize
new1.93 KB

Port to D7 for this usefull feature.

camdarley’s picture

StatusFileSize
new2.69 KB

Previous patch didn't update the taxonomy_menu table. This one does.

Status: Needs review » Needs work

The last submitted patch, Depthlimit-990512.patch, failed testing.

camdarley’s picture

Status: Needs work » Needs review

#6: Depthlimit-990512.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, Depthlimit-990512.patch, failed testing.

gianfrasoft’s picture

camdarley, do you think you will correct that patch?

Thanks.

gianfrasoft’s picture

However I applied patch at #6 and it seems it works perfectly.

Many thanks!

dstol’s picture

Status: Needs work » Needs review

#6: Depthlimit-990512.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, Depthlimit-990512.patch, failed testing.

k.skarlatos’s picture

its working for us too (latest core and taxonomy menu)

hles’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Component: Sync » Code

Needs to be ported to 7.x-2.x, needs tests.

keenubee’s picture

StatusFileSize
new2.11 KB

Please test another patch :)

keenubee’s picture

Status: Needs work » Needs review
Issue tags: +menu, +taxonomy, +patch, +depth
StatusFileSize
new2.11 KB

Not correct status in previous comment.

johnv’s picture

IMO 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

Grayside’s picture

#17 appears to work for me.

jmoughon’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I have implemented and tested the patch in #17. Recommend adding it to dev.

jamestombs’s picture

Status: Reviewed & tested by the community » Needs work

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

jmoughon’s picture

StatusFileSize
new2.67 KB

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

sovarn’s picture

#22 introduces a function called term_depth(). However there is no function called term_depth so it causes an error.

jmoughon’s picture

StatusFileSize
new3.33 KB

Good catch. I have updated the patch to add a helper function to the database.inc.

kenorb’s picture

Status: Needs work » Needs review

dkre.one queued 24: maxdepth-990512-24.patch for re-testing.

alex.bukach’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Issue tags: -menu, -taxonomy, -patch, -depth
StatusFileSize
new3.17 KB

Re-rolled and updated the path against current 7.x-1.x head.

aby v a’s picture

StatusFileSize
new401 bytes

Hi,

I have corrected some coding standard problems.

alex.bukach’s picture

Right aby v a, will you post the whole patch?

aby v a’s picture

StatusFileSize
new3.17 KB

Hi Alex Bukach,

I have updated the whole patch. Kindly check it.

brayfe’s picture

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

sibopa’s picture

Thanks guys.
#30 worked for me as well.

  • dstol committed bf642b7 on 7.x-1.x authored by aby v a
    Issue #990512 by jmoughon, camdarley, keenubee, aby v a, Alex Bukach,...
dstol’s picture

Status: Needs review » Fixed

Thanks, committed to 7.x-1.x.

Status: Fixed » Closed (fixed)

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