added BS4, activated module, went to content display settings, select bs 1col to test out the module, clicked save = WSOD with no logged messages.

uninstalled module, went to content display settings, then error page with:

"The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "bs_1col" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php)."

can't even revert to my previous display settings...

Display suite 8.x-2.6
Layout plugin 8.x-1.0-alpha23

Comments

telegraph created an issue. See original summary.

markhalliwell’s picture

Title: problems... » Unset/change layouts on uninstall
Version: 8.x-4.0 » 8.x-4.x-dev

I'm inclined to say that this is really a DS bug (or whatever module that implements layout selection... maybe even layout_plugin) for not catching the exception when a layout isn't found (e.g. broken plugin). Should probably search their queue or create another related issue to this one too.

That being said, it probably wouldn't hurt for this module to loop through existing layouts prior to uninstall and... change/unset them? Just not sure to what or how that would be feasible given we don't know the new layout regions. Maybe just find first available layout with first available region?

In the mean time, easy work around is to reinstall the module (via drush or drupal-console), go back to that page, switch layouts to something not provided by this module and then uninstall it.

telegraph’s picture

easy work around is to reinstall the module (via drush or drupal-console), go back to that page, switch layouts to something not provided by this module

I would, were it not for the WSOD for that content type's view mode

markhalliwell’s picture

  • The WSOD shouldn't be in all admin areas, especially /admin/modules which is all you need to re-enable the module.
  • It's also why I mentioned using drush or drupal-console to enable it instead since it's via terminal and not the site itself.
telegraph’s picture

Hi Mark, thanks for your responses, and my apologies for not being clear: the problem is not enabling/disabling the module.

The WSOD happens on the view mode for the page (my view mode is called 'landing', the WSOD happens on /admin/structure/types/manage/page/display/landing - the very page I'm supposed to revert to the old display type).

The other displays work fine, the end pages work, everything works fine, what doesn't work is editing the display for that view mode because that's where the WSOD is. So I can't even re-order the fields or anything anymore for that view mode

telegraph’s picture

StatusFileSize
new60.37 KB

attached a screenshot

markhalliwell’s picture

Title: Unset/change layouts on uninstall » Warn/unset/change layouts on uninstall

the problem is not enabling/disabling the module

Yes it is.

You have uninstalled a module that was providing an active layout to something.

You cannot just "simply remove it" and then continue to expect something that was using it to keep on working.

The reason you're getting a WSOD is because the module which provides the layout (plugin) is not installed, thus causing a fatal exception about a "missing plugin".

If you simply enable the module (for just a quick second) and rebuild the cache, that page will suddenly start to work.

Once it's re-enabled, only then will you be able to switch the layouts to something else.

After you've chosen a layout other than Bootstrap Layouts, you can safely uninstall the module again.

markhalliwell’s picture

Title: Warn/unset/change layouts on uninstall » Validate module uninstall
Issue summary: View changes
StatusFileSize
new82.12 KB
new116.1 KB

So, there's actually a ModuleUninstallValidatorInterface that will allow us to loop through and detect which instances are using the layouts for the provided handlers. This would actually prevent the module from being able to be uninstalled at all and also provide "reasons" to assist in locating where they're being used:

They'll even show up in Drush. Currently there's a bug that will show it via a thrown exception, but https://github.com/drush-ops/drush/pull/2494 will make it look better (like the above image).

  • markcarver committed 2a9cfc8 on 8.x-4.x
    Issue #2834394 by markcarver, telegraph: Validate module uninstall
    
markhalliwell’s picture

Status: Active » Fixed
StatusFileSize
new14.09 KB
markhalliwell’s picture

Category: Bug report » Feature request

This is technically a feature.

telegraph’s picture

I understand your reasoning in #7, but the problem was selecting a bs layout, saving this and then getting a white screen: I could not go back into the page settings and remove the layout (which is why I attempted the module uninstall, in hope I could correct it that way).

But beyond this, the 8.x-4.1 release corrected all these problems for me and works great, so thank you very much.

I checked the new validate module uninstall functionality and that works great too, it's also appreciable to have the location of the layouts listed.

Cheers for the fix! :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.