Suggested commit message:

Issue #2195957 by alexpott, tagini: Fixed Only install profile configuration when installing that profile, not when enabling associated modules.

If you try, in the D8 UI, to install/enable the CKEditor module and the Text Editor module at the same time, you get a fatal error. After which Editor is installed, but not CKEditor, and luckily the site is working OK, even though you got to the dreaded "rebuild needed" text. After that you can go back to Extend and install CKEditor and all is well.

Here's the error message:

If you have just changed code (for example deployed a new module or moved an existing one) read http://drupal.org/documentation/rebuild
Additional uncaught exception thrown while handling exception.

Original

Drupal\Component\Plugin\Exception\PluginException: The plugin (ckeditor) did not specify an instance class. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 62 of /home/s20b4ed78094d56d/www/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('ckeditor', Array)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('ckeditor', Array)
Drupal\Component\Plugin\PluginManagerBase->createInstance('ckeditor')
Drupal\editor\Entity\Editor->__construct(Array, 'editor')
Drupal\Core\Config\Entity\ConfigStorageController->create(Array)
Drupal\Core\Config\ConfigInstaller->installDefaultConfig('module', 'editor')
Drupal\Core\Extension\ModuleHandler->install(Array)
Drupal\system\Form\ModulesListConfirmForm->submitForm(Array, Array)
call_user_func_array(Array, Array)
Drupal\Core\Form\FormBuilder->executeHandlers('submit', Array, Array)
Drupal\Core\Form\FormBuilder->processForm('system_modules_confirm_form', Array, Array)
Drupal\Core\Form\FormBuilder->buildForm('system_modules_confirm_form', Array)
Drupal\Core\Controller\FormController->getContentResult(Object)
call_user_func_array(Array, Array)
Drupal\Core\Controller\HtmlPageController->getContentResult(Object, Array)
Drupal\Core\Controller\HtmlPageController->content(Object, Array)
call_user_func_array(Array, Array)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\HttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
drupal_handle_request()
Additional

Exception: _theme() may not be called until all modules are loaded. in _theme() (line 401 of /home/s20b4ed78094d56d/www/core/includes/theme.inc).

_theme('maintenance_page', Array)
drupal_render(Array)
_drupal_log_error(Array, 1)
_drupal_exception_handler(Object)
Files: 
CommentFileSizeAuthor
#15 2195957.15.patch5.77 KBWim Leers
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 78,952 pass(es). View
#14 2195957.test-only.patch594 bytesalexpott
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 78,862 pass(es), 0 fail(s), and 1 exception(s). View

Comments

swentel’s picture

You get the same kind of error if you uninstall the ckeditor. The node/add form or on admin/config/content/formats you'll get:

Drupal\Component\Plugin\Exception\PluginException: The plugin (ckeditor) did not specify an instance class. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 62 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

I would call this critical.

swentel’s picture

Related to #2007248: When CKEditor module is uninstalled, the right text editor config entities are affected but their labels are missing - which in itself is postponed on a META issue regarding plugin dependencies.

Wim Leers’s picture

Issue summary: View changes

Update the error message to the latest.

tagini’s picture

Assigned: Unassigned » tagini
tagini’s picture

The issue only presents itself when Drupal has been installed using the standard install profile. With the minimal install profile it does not.
I also found that it's actually only the (text) editor module that throws the error, not CKEditor.

This makes me think that the problem revolves around the text formats which are installed by the standard profile.

Steps to reproduce:
- Install Drupal with 'standard' install profile
- Uninstall CKEditor and Text Editor modules (as standard profile installs them by default)
- Install Text Editor module
--> Produces error

tagini’s picture

Issue tags: +Amsterdam2014
tagini’s picture

Investigating further I can confirm this problem is about the text formats.

When I remove the relevant files from the standard install profile, and try the steps I no longer get an error. Next I will be investigating if the editor module maybe does something wrong on uninstalling the text formats

tagini’s picture

Looking through the text formats that are installed by the standard profile, my guess is that the dependency on the ckeditor module is the culprit.

Somehow, when deinstalling the editor module, this dependency stays behind somewhere which causes an error when attempting to reinstall.

jhodgdon’s picture

Priority: Normal » Major

I'm glad someone is looking into this! Thanks tagini!

This is probably at least a Major bug, since it causes a system break.

Wim Leers’s picture

Component: ckeditor.module » base system
Priority: Major » Critical

Yes, agreed. And actually probably even critical. Moving to critical for now.

This really does feel like either a ModuleHandler or CMI bug though. tagini's excellent investigative work strongly points in that direction.

alexpott’s picture

Tagging

alexpott’s picture

The problem here is being caused by the default configuration from the standard profile being used again. The editor.editor.basic_html and editor.editor.full_html in standard profile have dependencies on ckeditor. We need to stop install profile configuration when config install is not being run during a Drupal install.

alexpott’s picture

Status: Active » Needs review
FileSize
594 bytes
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 78,862 pass(es), 0 fail(s), and 1 exception(s). View
5.78 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 78,958 pass(es). View

The attached patch makes the config installer only scan the profile module's configuration during installation.

Wim Leers’s picture

Title: Cannot enable/install CKEditor and Editor modules at the same time » Only install profile configuration when installing that profile, not when enabling associated modules
Issue summary: View changes
FileSize
5.77 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 78,952 pass(es). View
1.61 KB
+++ b/core/profiles/standard/src/Tests/StandardTest.php
@@ -100,6 +100,18 @@ function testStandard() {
+    // Ensure that configuration from the standard profile is not reused when
+    // enabling a module again since it contains configuration that can not be
+    // installed. For example, editor.editor.basic_html is editor configuration
+    // that depends on the ckeditor module. The ckeditor module can not be
+    // installed before the editor module since it depends on the editor module.
+    // The installer does not have this limitation since it ensures that all of
+    // the install profiles dependencies are installed before creating the
+    // editor configuration.

This is a crystal clear explanation. Wonderful. Thank you!


Rerolling to fix nitpicks.


I should not be credited, but tagini should be — he did excellent investigative work that was substantial to solving the issue. And that's for his first core issue! Great work, tagini — thanks! :)

Hence added a suggested commit message to the IS.

The last submitted patch, 14: 2195957.test-only.patch, failed testing.

Berdir’s picture

Assigned: tagini » Unassigned
Status: Needs review » Reviewed & tested by the community

This looks good to me.

I tested it on my install profile, which has a lot of configuration and all seems fine.

Test addition looks fine as well and fails right now.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Nice find :)

+++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php
@@ -105,8 +106,16 @@ public function installDefaultConfig($type, $name) {
+    // Unless we installing the profile remove it.

Fixed this on commit.

"Unless we are installing the profile, remove it from the list."

Committed/pushed to 8.0.x, thanks!

  • catch committed 5ab43b6 on 8.0.x
    Issue #2195957 by Wim Leers, alexpott: Fixed Only install profile...

  • catch committed 5f38198 on 8.0.x
    Revert "Issue #2195957 by Wim Leers, alexpott: Fixed Only install...
  • catch committed 6d58240 on 8.0.x
    Issue #2195957 by alexpott, tagini: Fixed Only install profile...
Wim Leers’s picture

Thanks for fixing for commit credit! :) And congrats, tagini, with your first core commit — a critical one to start with, very impressive!

Status: Fixed » Closed (fixed)

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