Updated: Comment #0

Problem/Motivation

#1776830: [META-1] Installation and uninstallation of configuration provided by a module that belongs to another module's API won't solve all of our problems. When the node module is uninstalled, the frontpage view is left behind. It shouldn't be.

Proposed resolution

When a module providing a base table is uninstalled, delete all views built on it.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

#1776830: [META-1] Installation and uninstallation of configuration provided by a module that belongs to another module's API

CommentFileSizeAuthor
#6 2079121-6-views-base-tables.patch1.33 KBAnonymous (not verified)
#4 2079121-views-base-tables.patch1.27 KBAnonymous (not verified)
#1 vdc-2079121-1.patch1.09 KBtim.plunkett
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
1.09 KB
jibran’s picture

  1. +++ b/core/modules/views/views.install
    @@ -27,3 +27,29 @@ function views_schema_0() {
    +  if ($tables) {
    

    I think we should add !empty check here.

  2. +++ b/core/modules/views/views.install
    @@ -27,3 +27,29 @@ function views_schema_0() {
    +    $views = $view_storage->loadMultiple($query);
    

    Do we have to check $query is empty or not?

dawehner’s picture

+1 in general.

Anonymous’s picture

updated patch after discussion with timplunkett in IRC.

'get all tables that are being removed, and get all tables that are from hook_views_data() implemenations that are being uninstalled.'

Status: Needs review » Needs work

The last submitted patch, 2079121-views-base-tables.patch, failed testing.

Anonymous’s picture

Status: Needs work » Needs review
FileSize
1.33 KB

ahem.

catch’s picture

Field module prevents module uninstall if a field providing module has an active field/instance, this is nuking views if the module is uninstalled. I think we need to pick one set of behaviour for config that's dependent on multiple modules and stick with it, so postponing on #2080823: Create API to discover config entities' soft dependencies and use this to present a confirm form on module uninstall.

alexpott’s picture

Status: Needs review » Postponed

Actually postponing...

I tested this last night and the interesting thing is that whilst the frontpage view remains in active config after uninstalling node the view is not listed in views ui and the path returns a 404. So I'm not 100% certain we have a bug.

catch’s picture

The problem would be when node module is eventually re-installed one day. If node changes its views plugins in the meanwhile, it'll have updates that update existing views to fix them (or there'll need to be some other mechanism to update the config to match new plugin IDs). However since node module is uninstalled, those updates won't run - then when node module is re-enabled what's the status of the view that's in active config?

andypost’s picture

Issue summary: View changes
Status: Postponed » Needs review
alexpott’s picture

Status: Needs review » Closed (duplicate)

This will be handled by the config dependency system - #2267453: Views plugins do not store additional dependencies