Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File entity doesn't disable the core files list view which causes two files tabs to display. #49

Open
Sam152 opened this issue Oct 26, 2015 · 4 comments

Comments

@Sam152
Copy link

Sam152 commented Oct 26, 2015

It looks like there is some code in the installer which disables the core view:

if ($view = View::load('files')) {
$view->disable();
$view->save();
}

This code works, but for some reason it cannot load the view during the installation of file_entity, even though file is a dependency.

@Berdir
Copy link
Member

Berdir commented Oct 26, 2015

How are you installing file_entity? The only reason that view wouldn't exist is if you are installing it together with file with a config deployment or the config_installer profile. We need to add a config sync check, see forum_install.

@Sam152
Copy link
Author

Sam152 commented Oct 26, 2015

It's being installed as a normal module dependency of an install profile, see here: https://github.com/previousnext/agov/blob/8.x-1.x/agov/agov.info.yml. We have a version of the module commited to the install profile due to some makefile workflow issues, see: https://github.com/previousnext/agov/blob/8.x-1.x/agov/modules/custom/file_entity/file_entity.install

@Berdir
Copy link
Member

Berdir commented Oct 27, 2015

Ah, I think I know what's happening.

views.view.files is optional config. All optional config is installed at the end of the install process.

So yeah, this doesn't work anymore. As a quickfix, you can put an config override in your install profile and set the status there to disabled. Maybe we need to listen in on hook_view_presave() and disable it there if it's new config and not syncing? Not really a nice solution.

@Berdir
Copy link
Member

Berdir commented Nov 16, 2015

Discussed this a bit with Alex Pott. It seems like the easiest option would be to move that default configuration from file.module to the standard install profile. Then that code would still work if you enable file_entity on an existing site as the config exists at that point and a different install profile could do whatever it wants anyway. Would be an BC for install profiles relying on this, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants