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

Files: 
CommentFileSizeAuthor
#6 2079121-6-views-base-tables.patch1.33 KBbeejeebus
PASSED: [[SimpleTest]]: [MySQL] 58,376 pass(es).
[ View ]
#4 2079121-views-base-tables.patch1.27 KBbeejeebus
FAILED: [[SimpleTest]]: [MySQL] 58,007 pass(es), 1 fail(s), and 26 exception(s).
[ View ]
#1 vdc-2079121-1.patch1.09 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 58,417 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.09 KB
PASSED: [[SimpleTest]]: [MySQL] 58,417 pass(es).
[ View ]

  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?

+1 in general.

StatusFileSize
new1.27 KB
FAILED: [[SimpleTest]]: [MySQL] 58,007 pass(es), 1 fail(s), and 26 exception(s).
[ View ]

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.

Status:Needs work» Needs review
StatusFileSize
new1.33 KB
PASSED: [[SimpleTest]]: [MySQL] 58,376 pass(es).
[ View ]

ahem.

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 content or config entities' soft dependencies and use this to present a confirm form on module uninstall.

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.

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?