ORIGINAL POST:
Even if it's turned off in the configuration screen, it's impossible to uncheck the box in the list of modules to de-activate it. Tested on Drupal 8.0.2.

CURRENT ISSUE:
Attempting to uninstall the SMTP module gives the following error:

Message Drupal\Core\Config\ImmutableConfigException: Can not set values on immutable configuration system.mail:interface. Use \Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object in Drupal\Core\Config\ImmutableConfig->set() (line 32 of /srv/bindings/2cc586e53d6d4f85b2ce2edfa90e7b7f/code/core/lib/Drupal/Core/Config/ImmutableConfig.php).

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

artecnico created an issue. See original summary.

ptmkenny’s picture

Issue summary: View changes

modules can no longer be disabled in D8

I'm updating the issue because it seems the real bug here is that it can't be uninstalled, which should be supported in D8.

ptmkenny’s picture

Title: Unable to de-activate the module » Uninstall fails with ImmutableConfigException
Arlina’s picture

Status: Active » Needs review
FileSize
603 bytes

Attached patch fixes the exception thrown when uninstalling the module.

iamanupmenon’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
136.19 KB

Checked
I can uninstall when the module is enabled
No error comes up then

Also i cannot disable the module, the checkbox is disabled by default

Attached screenshot Only local images are allowed.

Anonymous’s picture

verified patch

 drush -y pm-uninstall smtp
	The following extensions will be uninstalled: smtp
	Do you really want to continue? (y/n): y
	Drupal\Core\Config\ImmutableConfigException: Can not set values on immutable      [error]
	configuration system.mail:interface. Use
	\Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable
	configuration object in
	/srv/www/d8/core/lib/Drupal/Core/Config/ImmutableConfig.php:32
	Stack trace:
	#0 /srv/www/d8/modules/smtp/smtp.install(37):
	Drupal\Core\Config\ImmutableConfig->set('interface', NULL)
	#1 [internal function]: smtp_uninstall()
	#2
	/srv/www/d8/core/lib/Drupal/Core/Extension/ModuleHandler.php(382):
	call_user_func_array('smtp_uninstall', Array)
	#3
	/srv/www/d8/core/lib/Drupal/Core/Extension/ModuleInstaller.php(381):
	Drupal\Core\Extension\ModuleHandler->invoke('smtp', 'uninstall')
	#4
	/srv/www/d8/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(95):
	Drupal\Core\Extension\ModuleInstaller->uninstall(Array, true)
	#5
	phar:///srv/www/drush/drush.phar/commands/core/drupal/environment.inc(227):
	Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall(Array)
	#6
	phar:///srv/www/drush/drush.phar/commands/core/drupal/pm_8.inc(82):
	drush_module_uninstall(Array)
	#7
	phar:///srv/www/drush/drush.phar/commands/pm/pm.drush.inc(1237):
	_drush_pm_uninstall(Array)
	#8 phar:///srv/www/drush/drush.phar/includes/command.inc(366):
	drush_pm_uninstall('smtp')
	#9 phar:///srv/www/drush/drush.phar/includes/command.inc(217):
	_drush_invoke_hooks(Array, Array)
	#10 phar:///srv/www/drush/drush.phar/includes/command.inc(185):
	drush_command('smtp')
	#11
	phar:///srv/www/drush/drush.phar/lib/Drush/Boot/BaseBoot.php(67):
	drush_dispatch(Array)
	#12 phar:///srv/www/drush/drush.phar/includes/preflight.inc(66):
	Drush\Boot\BaseBoot->bootstrap_and_dispatch()
	#13 phar:///srv/www/drush/drush.phar/includes/startup.inc(321):
	drush_main()
	#14 phar:///srv/www/drush/drush.phar/drush(114):
	drush_startup(Array)
	#15 /srv/www/drush/drush.phar(10): require('phar:///data/we...')
	#16 {main}

 cd modules/smtp
 wget https://www.drupal.org/files/issues/smtp-uninstall_fails_with-2653338-4.patch
 patch -p1 < smtp*patch

 drush -y pm-uninstall smtp
  smtp was successfully uninstalled.                                                [ok]
 drush cr
  Cache rebuild complete.                                                           [ok]
 drush -y en smtp
  smtp was enabled successfully.                                                    [ok]
TheodorosPloumis’s picture

Patch worked for me too. Thanks.

wundo’s picture

Status: Reviewed & tested by the community » Needs work

Please re-roll this patch.

asrob’s picture

Status: Needs work » Fixed

Hi,

afaik this is in the last dev, that's why I changed its status.

ws.agency’s picture

Status: Fixed » Active

Still getting same issue with latest dev.

Drupal\Core\Config\ImmutableConfigException: Can not set values on immutable configuration system.mail:interface. Use \Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object in Drupal\Core\Config\ImmutableConfig->set() (line 32 of /core/lib/Drupal/Core/Config/ImmutableConfig.php).

anish.a’s picture

Priority: Minor » Major
Status: Active » Needs review

This is fixed in the latest branch. Please verify so that we can close this.

Issue #2651976

Commit ID:
23e78da06cacdb165f6fcf582a8d61ff6e6869b8

estoyausente’s picture

Status: Needs review » Fixed

The uninstall process have not this error anymore. I tested it several times using UI and using drush and the process (In the last dev version) has been finished correctly.

Status: Fixed » Closed (fixed)

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