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.
When using the $plugin = array() style plugin definition with a plugin type that is cached, the cached $plugin variable is overridden when the plugin definition file is included. This could possibly be an issue with function plugins to but ctools_plugins_get_function is much less dependent on processing so its not evident.
Attached patch changes the variable name in both functions to protect them from accidental overwriting.
I've tested this locally and everything works as expected.
Comment | File | Size | Author |
---|---|---|---|
ctools_plugin_variable_harderning.patch | 6.03 KB | neclimdul |
Comments
Comment #1
neclimdulI'm going to actually bump this up to critical. If function definitions are deprecated per #711664: Make global plugins definition hooks optional, then the $plugin = array() method is the preferred method for class plugin definition and files can't be included unless the definition file explicitly sets the include file. Not that I'm worried about merlin committing it but its pretty important. :)
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted to 6.x; needs to go to 7.x
Comment #3
neclimdulCommitted to 7