Closed (won't fix)
Project:
Drupal core
Version:
5.14
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jul 2007 at 11:50 UTC
Updated:
27 May 2011 at 02:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
Wesley Tanaka commentedin the case that caching is disabled for a site (the default behavior of drupal, IIRC), the upcoming patch will, by fixing the above-described bug, reduce by one the number of database queries on every single page view without affecting functionality in any way.
Comment #2
Wesley Tanaka commenteds/upcoming/attached/
Comment #3
Wesley Tanaka commentedSame patch, rerolled for 5.6
Comment #4
sinasalek commentedHi,
reasonable patch. two question
1. you added below code which is not in the unpatched version. why did you add it?
2.why don't you add your code to page_get_cache() function? so it won't get called anywhere when cache is disabled
Comment #5
Wesley Tanaka commented1. The ob_start() is needed to keep the ob_start() and ob_get_contents() calls balanced in that particular case.
2. Because the switch(variable_get('cache')) is already in _drupal_cache_init().
A slightly cleaner change would pull ob_start() out of page_get_cache() and into _drupal_cache_init(), but this would change the semantics of page_get_cache() which is technically a public function, even if it's called from only one place in core.
Patch still cleanly applies to 5.7, bumping version.
Comment #6
drummLooks okay, and does still apply. I think the only thing missing is a code comment explaining why ob_start() is called.
Comment #7
Wesley Tanaka commentedSame patch, rerolled for 5.14, and with an explanatory comment above the ob_start() call
Comment #8
tr commentedThis is not needed anymore because in Drupal 6.x page_get_cache() is never called when CACHE_DISABLED is TRUE. This was done in a slightly different way than the above patch. From the Drupal 6.x source for bootstrap.inc, this is the only line where page_get_cache() is invoked:
As this has already been addressed in Drupal 6.x, and as Drupal 5.x is no longer supported, we can safely close this issue.