Problem/Motivation
Trying to uninstall this module using drush pmu fixteaserlinkstriggers an exception ('Drupal\Core\Config\ImmutableConfigException' with message 'Can not clear fixteaserlinks_comment key in immutable configuration fixteaserlinks.settings.')
Trying to uninstall using the admin section of drupal results in a WSOD.
Proposed resolution
Install the latest development snapshot, or remove hook_uninstall().
Drupal 8 automatically cleans up the configuration upon uninstall, so there is no need to use hook_uninstall() to remove these two variables from the datebase (and doing so will trigger an exception).
Remaining tasks
Requires review of proposed solution.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
znak commentedComment #3
znak commentedThe problem fix this patch
Comment #4
dzinelabs commentedThat patch does not work:
patched install file:
/**
* @file
* Install and uninstall hooks.
*/
/**
* Implements hook_uninstall().
*/
function fixteaserlinks_uninstall() {
$config = \Drupal::getContainer()->get('config.factory')->getEditable fixteaserlinks.settings');
$config->clear('fixteaserlinks_comment');
$config->clear('fixteaserlinks_readmore');
$config->delete();
}
uninstalling using drupal again WSOD and using drush:
ParseError: syntax error, unexpected 'fixteaserlinks' (T_STRING) in [error]
module_load_include() (line 12 of
/home/d38625/public_html/projects/Drupal8/modules/fixteaserlinks/fixteaserlinks.install)
#0
/home/d38625/public_html/projects/Drupal8/core/includes/module.inc(93):
module_load_include('install', 'fixteaserlinks')
#1
/home/d38625/public_html/projects/Drupal8/core/lib/Drupal/Core/Extension/ModuleInstaller.php(387):
module_load_install('fixteaserlinks')
#2
/home/d38625/public_html/projects/Drupal8/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(91):
Drupal\Core\Extension\ModuleInstaller->uninstall(Array, true)
#3 /home/d38625/drush/commands/core/drupal/environment.inc(227):
Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall(Array)
#4 /home/d38625/drush/commands/core/drupal/pm_8.inc(80):
drush_module_uninstall(Array)
#5 /home/d38625/drush/commands/pm/pm.drush.inc(1235):
_drush_pm_uninstall(Array)
#6 /home/d38625/drush/includes/command.inc(364):
drush_pm_uninstall('fixteaserlinks')
#7 /home/d38625/drush/includes/command.inc(215):
_drush_invoke_hooks(Array, Array)
#8 /home/d38625/drush/includes/command.inc(183):
drush_command('fixteaserlinks')
#9 /home/d38625/drush/lib/Drush/Boot/BaseBoot.php(65):
drush_dispatch(Array)
#10 /home/d38625/drush/includes/preflight.inc(64):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#11 /home/d38625/drush/includes/startup.inc(289): drush_main()
#12 /home/d38625/drush/drush(115): drush_startup(Array)
#13 {main}.
ParseError: syntax error, unexpected 'fixteaserlinks' (T_STRING) in module_load_include() (line 12 of /home/d38625/public_html/projects/Drupal8/modules/fixteaserlinks/fixteaserlinks.install).
Drush command terminated abnormally due to an unrecoverable error.
Comment #6
gisleI've removed the file
fixteaserlinks.installwhose sole content was an unneededhook_uninstall().Please review.
Comment #7
dzinelabs commented@gisle, removing the .install file did solve the problem.
Thank you.
Comment #8
gisledzinelabs wrote:
Thanks for the review, dzinelabs. Since the change has been pushed to the repo, I've moving this to "Fixed".