In category_get_children() the second db_query appears to be missing a %d placeholder
for $cid.

CommentFileSizeAuthor
#1 category.inc_3.patch1015 bytesbdragon

Comments

bdragon’s picture

Status: Active » Needs review
StatusFileSize
new1015 bytes

Origin of line in question:
http://drupal.org/cvs?commit=32569

I agree. This looks to me like it would cause serious memory bloat and possibly bugs.

Here's a patch.

Jaza’s picture

Title: Category.inc line 281 missing %d in 4.7.0 branch » Fix the caching strategy used by category module functions
Status: Needs review » Needs work

The commit in question was a big overall change to the caching strategy used by the category module. It was a very rushed affair, and its rapid development was sponsored by Robert Douglass, who at the time needed some performance improvements and needed them fast. Since then, I have realised that the changes introduced by this commit actually worsened the performance of the category module, but I haven't had time to re-evaluate the problem and to develop a better solution.

category_get_children() is just one of many functions that were affected by this change, and as such, it is just one of many that will need to be fixed. I will be looking at this problem in more detail when I get a chance.

marcoBauli’s picture

please have a look also at the main Memory and Performances issue at http://drupal.org/node/82554

maybe this can be setted as duplicate?

ty

Jaza’s picture

Status: Needs work » Closed (duplicate)

Thanks for pointing out that other issue thread, Marco - I must have missed it. Marking this thread as duplicate of http://drupal.org/node/82554

jvandervort’s picture

Patch note: After applying this patch, category view only shows one level of children.
ie, doesn't recurse to the level specified in the container.

deavidsedice’s picture

Patch note: After applying this patch, category view only shows one level of children.
ie, doesn't recurse to the level specified in the container.

Yes, this patch will corrupt "function category_get_children". And does not solve any caching problem.

I've written one patch to Category.inc on http://drupal.org/node/82554 ,and I feel that it will work better than this one.
If someone finds a bug using my patch, please, report it.