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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

neclimdul’s picture

Priority: Normal » Critical

I'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. :)

merlinofchaos’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed to 6.x; needs to go to 7.x

neclimdul’s picture

Status: Patch (to be ported) » Fixed

Committed to 7

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.