1. Users have to enable display extenders under the scary 'Advanced' settings page in order for them to work. If we convert extenders to drupal_alters() they can be self-contained in a module which can easily be turned off and on.
2. It requires a class/class registry in order to work.
3. Everything a display extender is doing is essentially an alter of each function inside the views display plugin.
4. We already have a conflict of parameters (PHP 5.3 warning) between views_plugin_display::option_definition and views_plugin_display_extenders::option_definition (which the latter is an alter...sensing a pattern here?).
I propose that we remove the display extender class and just replace them with calls to drupal_alter('views_plugin_display_[function]'). Using the class system when we have the perfectly valid method to perform alters in core seems like an over-complication.
I would assign this to dereine for comment since he was the lead in putting the display extenders into Views 3 but I don't have the permissions to.
Comments
Comment #1
Dave ReidIn addition:
5. Disable a module that provides a display extender and you suddenly get a fatal error since views_plugin_display::construct() still tries to load it. This will not happen when using hooks and drupal_alter().
Comment #2
Dave ReidTagging since this affects the Metatags module.
Comment #3
bojanz CreditAttribution: bojanz commentedAssigning to dereine.
Comment #4
dawehnerI'm not opposite to convert it to drupal_alters, but this should really merlinofchaos decide. So assigned him.
Here are some oppinions why a plugin is not that bad.
Perhaps metatags module could enable it by in install/update hooks.
Does really everything has to be a module which from it's functionality is more like a plugin, from the sight of crells definition.
Why is the advanced tab scary? Extending displays are somehow an advanced feature.
Which is actually a good thing, because people which are familiar with extending views will probably understand display extenders
as just another kind of plugin.
I'm not sure whether one additional class per view is really that hard compared to all other things which are runned at the same time.
Perhaps there are some problems with documentation how to write a display extender plugin.
Yes that's more or less true, but the dispaly extending "system" was written with decorators in mind, so this is "by design" :)
php_string--
Oh. This is certainly a bug which has to be fixed!
Comment #5
Dave ReidShort point is that making a class to extend the behavior of another class without being able to actually extend the parent class is kinda wrong in an OOP standpoint and more complicated than just simple altering.
Comment #6
Dave ReidI had also encountered WSOD errors in views_plugin_display::destroy() that I could not temporarily fix unlike construct() when a display extender was disabled.
Comment #7
dawehnerSome follow-issues
* #1279352: Document how to use display extenders
* #1279344: WSOD if display extender is used but module is disabled
Feel free to create some others as well.
Comment #8
Dave Reid#1279202: Make enabling display extenders easier for end-users
#1279182: Disabling a module with a display extender causes WSOD errors
Comment #9
Dave ReidAlso
#1281698: PHP strict warning: Declaration of views_plugins_display_extender::option_definition() does not match its parent class
Comment #10
dawehnerBeside the open bugs, i think this issue will not be fixed.
Comment #11
eabquina CreditAttribution: eabquina as a volunteer commentedI encounter the exact same issue.What could be a workaround to avoid this?
The site seems to be well, its just that the cache clear wont work wihtout any error.
EDIT: I just re-enabled the module that i removed and all works fine now.