Problem

Currently, this module disables the default "files" View during its hook_install() implementation. This works fine if the module is being enabled on an already installed site. But if it is part of the installation process of a custom installation profile, the registry of the View module will not have completed, and $view = View::load('files') will return FALSE and will not disable the core "files" View.

Steps to Reproduce

1. Add views and file_entity to the list of modules to be installed in an installation profile, either in its info.yml file or it its hook_install() implementation.
2. Install the site.
3. The core "files" view will remain enabled.

Proposed Solution

Move the disabling of the core view to hook_modules_installed().

Comments

mark_fullmer created an issue. See original summary.

mark_fullmer’s picture

Status: Active » Needs review
StatusFileSize
new626 bytes

Patch attached.

weseze’s picture

Just tried this patch with a clean install on D8.5 with our installation profile.
It only works if you rebuild cache between installing drupal and enabling this module.