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.

CommentFileSizeAuthor
#3 unable_to_uninstall-2856108-3.patch641 bytesznak

Comments

dzinelabs created an issue. See original summary.

znak’s picture

Assigned: Unassigned » znak
Status: Active » Needs work
znak’s picture

Assigned: znak » Unassigned
Status: Needs work » Needs review
StatusFileSize
new641 bytes

The problem fix this patch

dzinelabs’s picture

That 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.

  • gisle committed 3a96145 on 8.x-1.x
    #2856108 by gisle: Fixed unable to unistall by removing overreaching...
gisle’s picture

Issue summary: View changes

I've removed the file fixteaserlinks.install whose sole content was an unneeded hook_uninstall().

Please review.

dzinelabs’s picture

@gisle, removing the .install file did solve the problem.

Thank you.

gisle’s picture

Issue summary: View changes
Status: Needs review » Fixed

dzinelabs wrote:

@gisle, removing the .install-file did solve the problem.

Thanks for the review, dzinelabs. Since the change has been pushed to the repo, I've moving this to "Fixed".

Status: Fixed » Closed (fixed)

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