Needs work
Project:
Drupal core
Version:
main
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Feb 2015 at 21:12 UTC
Updated:
12 May 2025 at 12:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerNote: This is not a feature but rather a missing functionality, so a bug.
Do you mind writing some kind of test? I'm pretty sure we have test coverage for display extenders already.
Let's remove that line, the base class already implements it.Returning NULL is IMHO wrong.
Comment #2
devpreview commentedI have not yet figured out the testing system so that writing tests I can take some time.
I acted similarly to other methods from DisplayExtenderPluginBase class. e.g. buildOptionsForm() and optionsSummary().
This methods already defined of views\PluginBase class. But I do not understand why it was done and I do not see the need.
Comment #11
ckaotikI've attached a patch that adds both dependencies and caching information (if present) for a view's display_extender plugins. They weren't yet handled by the generic views plugin integrations for "one of a kind" plugins (e.g. one Query plugin, one Cache plugin etc.).
This will also help with #2635728: Uninstalling a module providing display extenders causes fatal errors as views using a display extender can now be identified by the uninstall validator. It can then warn about them being required as usual.
Currently, the display extender's configuration is added to every view/display (and thus with this patch its dependency as well), regardless of it actually using the functionality. This is mentioned in #1811986: Try to minimize the "overhead" of display extenders, and I tried to prevent this by introducing the
DisplayExtenderPluginBase::isEnabledmethod (using a very naive approach).We still need tests, though! And possibly an update hook that updates all views with extenders to remove excess data?
Comment #12
joachim commentedLooks good, just a nitpick:
Nitpick: first line doc comment should be present tense, so 'Determines ...'.
Also, needs work because this needs tests?
Comment #13
deepak goyal commentedUpdated patch please review.
Comment #14
deepak goyal commentedComment #16
colanWhat's the actual problem here? What is it trying to solve? How does the solution work? Will it have any effect on #3160900: Entire view is deleted on module uninstallation after depending display is deleted?
Comment #17
geek-merlinComment #18
joachim commentedI've updated the IS.
The patch adds the dependency correctly to my view.
However, uninstalling the module that provides the extender makes the config system delete the view complete. The correct behaviour would be for the display plugin to implement onDependencyRemoval() and remove the extender's settings from the view.
To do that though, we need the View::onDependencyRemoval() to call onDependencyRemoval() on the display plugin, which AFAICT it doesn't. That should probably be fixed as a separate issue first.
Comment #19
ckaotikI agree, giving display extenders and views plugins in general the option to provide a
onDependencyRemovalmethod would help with some of the related issues. I've updated the IS accordingly.That issues' problem is that dependencies (those that are tracked correctly) are always propagated to the whole view. This a patch for this issue will not help there, quite the opposite because more dependencies (that were previously invisible) will be tracked. That issue may come up with a solution to storing dependencies on a per-display basis, or investigate wha the global dependencies are not updated correctly on changes, i.e. when the "needing" display is removed.
However, #2426607: Calculates and adds dependencies of views display extender (this issue) is about certain dependencies not being tracked at all, which can result in lost functionality and also cause #2635728: Uninstalling a module providing display extenders causes fatal errors during dependency uninstallation. Simply, because Drupal doesn't know the uninstalled module is a dependency.
Comment #20
ckaotikComment #28
mxr576Added test coverage, incorporated the latest fix from #13.