Calculates and adds dependencies of views display extender

Created on 14 February 2015, about 10 years ago
Updated 12 May 2025, about 12 hours ago

Problem/Motivation

A view that uses a view display extender does not get a config dependency on the module that provides the display extender plugin.

This means that the view may be broken (best case) or cause a WSOD ( #2635728: Uninstalling a module providing display extenders causes fatal errors ) if the module is uninstalled.

Steps to reproduce

  1. Have a view with a display using a display extender from a module that's not views, e.g. metatag (Code) or views_inject (Code)
  2. Uninstall the providing module (metatag, views_inject, ...)
  3. Notice: The view remains unchanged and can trigger a WSOD

Expected result is that the user is informed of this View requiring the module to be uninstalled and...

  • the user agrees to delete the View as a consequence (minimal transparency, see #11 & #13)
  • or the display extender is removed from all affected views/displays (convenient transparency, see #18)

Proposed resolution

  • Display extenders (and other similarly overlooked plugins) are noted when determining View dependencies
  • DisplayExtenderPluginBase provides an onDependencyRemoval method that removes the extender from all displays, overridable by the plugin itself

Remaining tasks

Discuss. Review existing code. Provide default onDependencyRemoval implementation.

API changes

TBD

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component

views.module

Created by

🇷🇺Russia devpreview

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024