At the moment its possible to accidently request and try to instantiate an abstract class from ctools.

Common code block I've run into:

  $foo = array();
  foreach($list as $plugin) {
    $c = ctools_plugin_load_class('module', 'type', $plugin, 'handler');
    if ($c) {
      $foo[] = new $c();
    }
  }

If you where provided an item in that list that points to an abstract class this could cause a fatal error on your page.

With the attached patch we provide some helpful filtering that helps avoid this.

Comments

neclimdul’s picture

I should note, this patch was built on top of patches #703040: Ctools object plugins can be broken when plugin caching is enabled. and #711664: Make global plugins definition hooks optional but separate so its easier to review.

edit: fix issue id

merlinofchaos’s picture

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

Looks like I committed this quite some time ago already.

merlinofchaos’s picture

Status: Patch (to be ported) » Closed (duplicate)

All of the 'to be ported' patches got merged in during the porting sprint in September.