When updating from Drupal 10.2.7 to Drupal 10.3.1, I get following after drush updb:
>[notice] Update started: editor_post_update_sanitize_image_upload_settings
> [error] Error: Call to a member function getConfigDependencyName() on null in Drupal\editor\Entity\Editor->calculateDependencies() (line 128 of /data/code/energyapp/www/core/modules/ed
itor/src/Entity/Editor.php) #0 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(324): Drupal\editor\Entity\Editor->calculateDependencies()
> #1 /data/code/energyapp/www/core/lib/Drupal/Core/Entity/EntityStorageBase.php(528): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStora
ge))
> #2 /data/code/energyapp/www/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\editor\Entity\Editor))
> #3 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(257): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\editor\Entity\Editor))
> #4 /data/code/energyapp/www/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\editor\Entity\Editor))
> #5 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(613): Drupal\Core\Entity\EntityBase->save()
> #6 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(192): Drupal\Core\Config\Entity\ConfigEntityBase->save()
> #7 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(147): Drupal\Core\Config\Entity\ConfigEntityUpdater->doOne(Object(Drupal\editor\Entity\Editor), Obj
ect(Closure))
> #8 /data/code/energyapp/www/core/modules/editor/editor.post_update.php(68): Drupal\Core\Config\Entity\ConfigEntityUpdater->update(Array, 'editor', Object(Closure))
> #9 /data/code/energyapp/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(280): editor_post_update_sanitize_image_upload_settings(Array)
> #10 /data/code/energyapp/vendor/drush/drush/includes/batch.inc(257): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('editor_post_upd...', Array)
> #11 /data/code/energyapp/vendor/drush/drush/includes/batch.inc(204): _drush_batch_worker()
> #12 /data/code/energyapp/vendor/drush/drush/includes/batch.inc(75): _drush_batch_command('154')
> #13 /data/code/energyapp/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(136): drush_batch_command('154')
> #14 [internal function]: Drush\Commands\core\UpdateDBCommands->process('154', Array)
> #15 /data/code/energyapp/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
> #16 /data/code/energyapp/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolida
tion\AnnotatedCommand\CommandData))
> #17 /data/code/energyapp/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(C
onsolidation\AnnotatedCommand\CommandData))
> #18 /data/code/energyapp/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\O
utput\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #19 /data/code/energyapp/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Obje
ct(Symfony\Component\Console\Output\ConsoleOutput))
> #20 /data/code/energyapp/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Co
mponent\Console\Output\ConsoleOutput))
> #21 /data/code/energyapp/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(
Symfony\Compone
> #22 /data/code/energyapp/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Compo
nent\Console\Output\ConsoleOutput))
> #23 /data/code/energyapp/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Com
ponent\Console\Output\ConsoleOutput))
> #24 /data/code/energyapp/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #25 /data/code/energyapp/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array)
> #26 /data/code/energyapp/vendor/drush/drush/drush(4): require('/data/code/ener...')
> #27 /data/code/energyapp/vendor/bin/drush(120): include('/data/code/ener...')
> #28 {main}.
> Error: Call to a member function getConfigDependencyName() on null in /data/code/energyapp/www/core/modules/editor/src/Entity/Editor.php on line 128 #0 /data/code/energyapp/www/core/li
b/Drupal/Core/Config/Entity/ConfigEntityBase.php(324): Drupal\editor\Entity\Editor->calculateDependencies()
> #1 /data/code/energyapp/www/core/lib/Drupal/Core/Entity/EntityStorageBase.php(528): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStora
ge))
> #2 /data/code/energyapp/www/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\editor\Entity\Editor))
> #3 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(257): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\editor\Entity\Editor))
> #4 /data/code/energyapp/www/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\editor\Entity\Editor))
> #5 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(613): Drupal\Core\Entity\EntityBase->save()
> #6 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(192): Drupal\Core\Config\Entity\ConfigEntityBase->save()
> #7 /data/code/energyapp/www/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(147): Drupal\Core\Config\Entity\ConfigEntityUpdater->doOne(Object(Drupal\editor\Entity\Editor), Obj
ect(Closure))
> #8 /data/code/energyapp/www/core/modules/editor/editor.post_update.php(68): Drupal\Core\Config\Entity\ConfigEntityUpdater->update(Array, 'editor', Object(Closure))
> #9 /data/code/energyapp/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(280): editor_post_update_sanitize_image_upload_settings(Array)
> #10 /data/code/energyapp/vendor/drush/drush/includes/batch.inc(257): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('editor_post_upd...', Array)
> #11 /data/code/energyapp/vendor/drush/drush/includes/batch.inc(204): _drush_batch_worker()
> #12 /data/code/energyapp/vendor/drush/drush/includes/batch.inc(75): _drush_batch_command('154')
> #13 /data/code/energyapp/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(136): drush_batch_command('154')
> #14 [internal function]: Drush\Commands\core\UpdateDBCommands->process('154', Array)
> #15 /data/code/energyapp/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
> #16 /data/code/energyapp/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolida
tion\AnnotatedCommand\CommandData))
> #17 /data/code/energyapp/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(C
onsolidation\AnnotatedCommand\CommandData))
> #18 /data/code/energyapp/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\O
utput\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #19 /data/code/energyapp/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Obje
ct(Symfony\Component\Console\Output\ConsoleOutput))
> #20 /data/code/energyapp/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Co
mponent\Console\Output\ConsoleOutput))
> #21 /data/code/energyapp/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(
Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #22 /data/code/energyapp/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Compo
nent\Console\Output\ConsoleOutput))
> #23 /data/code/energyapp/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Com
ponent\Console\Output\ConsoleOutput))
> #24 /data/code/energyapp/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #25 /data/code/energyapp/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array)
> #26 /data/code/energyapp/vendor/drush/drush/drush(4): require('/data/code/ener...')
> #27 /data/code/energyapp/vendor/bin/drush(120): include('/data/code/ener...')
> #28 {main}
> [warning] Drush command terminated abnormally.
In ProcessBase.php line 171:
Unable to decode output into JSON: Syntax error
Error: Call to a member function getConfigDependencyName() on null in Drupal\editor\Entity\Editor->calculateDependencies() (line 128 of /data/code/energyapp/www/core/modules/editor/src/Entity/Editor.php).
And it keeps failing on that. I have had this consistently on 3 different Drupal instances.
Quick and dirty workaround I used is:
- Edit file www/core/modules/editor/editor.post_update.php
- Remove the contents of function editor_post_update_sanitize_image_upload_settings()
- Run drush updb again.
Other people seem to uninstall ckeditor5 module to get around the problem.
It's "major" in the sense that everyone who upgrades to 10.3.x will probably get the error/problem.
Issue fork drupal-3463524
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
cilefen commentedThat function call is on line 126 not 128. Are patches applied?Comment #3
cilefen commented^ Ignore that comment. I misread the trace.
Comment #4
cilefen commentedgetFilterFormat()returns null. Why?Comment #5
sboden commentedThe sites which I upgraded are very simple sites: drupal/core-recommended (initially even installed at 10.2.7, not that long ago) with the least amount of contrib modules. On some back-end forms we use ckeditor but without special config, it's possible to upload images but none of the sites have uploaded images for the moment.
Comment #6
sboden commentedI tried installing a clean Drupal 10.2.7 (drupal/core-recommended) and upgrading to 10.3.1: works fine,
editor_post_update_sanitize_image_upload_settingsexecutes without problems.But for the moment I don't see what config on my real sites could crash
editor_post_update_sanitize_image_upload_settings.Comment #7
catchThis sounds similar-ish to #3460513: Avoid TypeError if config entity dependencies are NULL.
Can you double check your editor config entities, specifically:
format: the_format_nameAnd that these formats correspond to a text format i.e.
filter.format.*in config/syncAll I can think of is an editor is referring to a text format that no longer exists. If that's the error, we probably need to handle this and log an error instead of the fatal or similar.
Comment #8
sboden commented#7 is right. I played with drupal/webform in the beginning of the projects and removed it afterwards. But in the config I still had:
editor.editor.webform_default.yml: - filter.format.webform_default
editor.editor.webform_default.yml:format: webform_default
And "webform_default" does not exist anymore as a filter.
If this could be handled without fatal error it would be great.
Comment #9
catchBumping this to critical - enabling then uninstalling webform can't be that uncommon.
Here's an MR that should mean there's no fatal error on the upgrade path, but it's also possible that editor module isn't handling module uninstall correctly too.
Comment #11
catchComment #12
catchComment #13
alexpottWe need an issue to fix webform. Webform's using of filter formats has been causing a lot of problems.
I think the hardening is okay here and I like the use of trigger_error(). I think a test would be a nice thing to have.
Comment #14
liam morlandHow would a test for this work? Would it have to create a fake missing text format?
The message uses
$this->id()twice. That doesn't seem right to me.Should one of them instead be
$this->label()?Comment #15
quietone commentedComment #16
quietone commentedHad a go at a test.
Comment #17
quietone commentedComment #18
smustgrave commentedRemoving the test tag since test-only run show https://git.drupalcode.org/issue/drupal-3463524/-/jobs/8344357
Not sure if still valid with 10.3 been out for a while but going to mark.
Comment #19
alexpottCommitted 7f0e816 and pushed to 10.6.x. Thanks!
Committed and pushed 5e89bf91349 to main and 4fff169a7b3 to 11.x and 15e3a121b9b to 11.3.x. Thanks!
I forward ported the code change to 11.x, 11.3.x and main and I will open a follow-up to add test coverage there as the current test will not work on those branches because PHPUnit has removed the capability to expect a warning.
Comment #25
alexpottI've opened the follow-up to add the test coverage to the more recent branches - #3571469: Add test coverage for missing filter format when an editor config entity is saved