Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We're currently developing a site which has a very large taxonomy (>2M terms). The site is able to work as we're using the Leftandright module, and other associated modules.
When trying to view an image gallery, a call is made to _taxonomy_term_children() which fails as it tries to parse through all 2M plus terms and insert them into an array. The patch supplied works round this, increasing the number of SQL queries required, but no more than a drupal_get_tree call would.
Comment | File | Size | Author |
---|---|---|---|
taxonomy_term_children.patch | 859 bytes | sdrycroft | |
Comments
Comment #1
sdrycroft CreditAttribution: sdrycroft commentedI should add that the Image gallery is not using the 2M term vocabulary, but is instead using a single term vocabulary.
Comment #2
catchThis was refactored in #144969: taxonomy_term_count_nodes returns wrong count (+ tests) which is waiting for a backport. Does image.module call _taxonomy_term_children() directly or use taxonomy_term_count_nodes()
Comment #3
sdrycroft CreditAttribution: sdrycroft commentedIt uses taxonomy_term_count_nodes.
Comment #4
catchWould you mind testing the latest patch on #144969: taxonomy_term_count_nodes returns wrong count (+ tests) to see if it helps? That's more likely to get committed since it's pretty much the same as the code in HEAD now - but it's not used in core, and we didn't test it on large datasets, just made sure the counts were right.
Comment #5
Gábor Hojtsy@catch: not sure how is taxonomy_term_count_nodes() related to taxonomy_term_children()? Looks like this independent improvement would be useful for D7 and then backported to D6.
Comment #7
catchhttp://api.drupal.org/api/function/_taxonomy_term_children/6
Does not exist in Drupal 7, because it existed only as a helper function for taxonomy_term_count_nodes() which was refactored, then itself removed from D7.