Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2010 at 17:40 UTC
Updated:
14 Jan 2011 at 21:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
alex_b commentedThis patch:
- switches
ctools_plugin_api_include()to usectools_static().- introduces a
ctools_get_plugins_reset()function resetting all static variables affecting the result ofctools_get_plugins().- clean up
ctools_export_load_object_reset()by moving the reset of 'ctools_plugin_api_info' static cache toctools_get_plugins_reset()- call
ctools_get_plugins_reset()fromctools_export_load_object_reset().Comment #2
alex_b commentedMissing a ctools_include().
Comment #3
alex_b commentedSame as #2 but for Drupal 7.
Comment #4
alex_b commentedPlease disregard #3.
Comment #5
alex_b commentedMore general title as this issue affects other usage of Plugin API as well - #919866: Registry is rebuilt with stale information
Comment #6
alex_b commentedAs neclimdul commented on IRC, #4 will break in some circumstances as the static variable that it removes protects a file include that may include the same class definition, function definition twice.
Comment #7
neclimdulI think I may have figured out how to sort this out and its staged in my github branch. However, I wonder if #919866: Registry is rebuilt with stale information needs more from this function. Specifically clearing the cache table for this line:
Comment #8
alex_b commentedI have not yet further investigated registry rebuild issues in Drupal 7. However, I think we should clean up the caching situation in plugins.inc.
- In ctools_plugin_api_include() only throw static flag module files that have actually been included.
- Do not return a modified info array in ctools_plugin_api_include() because it will change depending on whether the static cache is hit or missed.
- Introduce a ctools_get_plugins_reset() to reset all drupal_static caches in plugins.inc
- Use ctools_get_plugins_reset() in export.inc rather than resetting drupal statics directly.
The enclosed patches fix the above issues for Drupal 6 and Drupal 7.
These patches fix a problem where static caches can't be cleared properly on installation (as reported in initial issue).
Comment #9
neclimdulSo this is getting fixed by the second half of the patch where you move the static cache testing inside the first foreach in ctools_plugin_api_include?
Comment #10
merlinofchaos commentedCommitted to all branches.