Unable to uninstall module from Drupal
When trying to uninstall this module, I'm unable to. The reason given is:
The following reason prevents Next.js from being uninstalled:
Next.js is configured to use a preview url generator plugin provided by this module. [Update settings](http:///admin/config/services/next/settings).
When I visit settings, I am unable to clear the plugin field:
There are no entities selected and no sites created. Any advice?
Hmm I think this might be a bug. We added a safety measure to prevent uninstalling a module with an active URL generator. Looks like we need to check if there's only one generator available.
Do you have access to the code?
We can use a temporary workaround to uninstall the module.
- Open the file
web/modules/contrib/next/src/NextUninstallValidator.php - Find the
validatefunction. - Update it to return `FALSE.
- Try uninstalling again.
/**
* {@inheritdoc}
*/
public function validate($module) {
return FALSE;
}
Hey - I ended up not needing to uninstall. I was trying to debug something unrelated by reinstalling a few things. So for my own use case, I'm good to go.
Up to you if you'd like to tackle or close this, I'll leave it open - thanks for the quick response, and really enjoying the plugin so far!
Ran into this today. Will just disable the uninstall validator :)
Ran into this problem as well.
In my case, I changed the next.settings.yml file, deleting the entry for the prview url generator:
langcode: es
site_previewer: iframe
site_previewer_configuration:
width: 100%
sync_route: false
sync_route_skip_routes: ''
preview_url_generator: simple_oauth <---- REMOVE THIS
preview_url_generator_configuration:
secret_expiration: 30
debug: false
Then drush cim and uninstall worked. But, of course, this should work without this workaround.