Can't run update.php after upgrade to 8.7.3: "Call to a member function getConfigDependencyName() on null in Drupal\Core\Entity\EntityDisplayBase->calculateDependencies()"

Created on 18 June 2019, almost 6 years ago
Updated 12 February 2023, about 2 years ago

Problem/Motivation

I updated Drupal Core to 8.7.3.

When I do update.php or drush up I get this error:

Error: Call to a member function getConfigDependencyName() on null in Drupal\Core\Entity\EntityDisplayBase->calculateDependencies() (line 314 of /var/www/jb-inflatables/public/core/lib/Drupal/Core/Entity/EntityDisplayBase.php).

The full log is at the end of the Issue Summary

Steps to reproduce

TBA

Proposed resolution

TBD

Remaining tasks

This needs steps to reproduce

User interface changes

API changes

Data model changes

Release notes snippet

The full log

Error: Call to a member function getConfigDependencyName() on null in Drupal\Core\Entity\EntityDisplayBase->calculateDependencies() (regel 314 van /var/www/jb-inflatables/public/core/lib/Drupal/Core/Entity/EntityDisplayBase.php) #0 /var/www/jb-inflatables/public/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(103): Drupal\Core\Entity\EntityDisplayBase->calculateDependencies() #1 [internal function]: Drupal\Core\Config\Entity\ConfigEntityUpdater->Drupal\Core\Config\Entity\{closure}(Object(Drupal\Core\Entity\Entity\EntityViewDisplay)) #2 /var/www/jb-inflatables/public/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(110): call_user_func(Object(Closure), Object(Drupal\Core\Entity\Entity\EntityViewDisplay)) #3 /var/www/jb-inflatables/public/core/modules/layout_discovery/layout_discovery.post_update.php(21): Drupal\Core\Config\Entity\ConfigEntityUpdater->update(Array, 'entity_view_dis...') #4 /var/www/jb-inflatables/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(298): layout_discovery_post_update_recalculate_entity_view_display_dependencies(Array) #5 /var/www/jb-inflatables/vendor/drush/drush/includes/batch.inc(251): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('layout_discover...', Object(DrushBatchContext)) #6 /var/www/jb-inflatables/vendor/drush/drush/includes/batch.inc(196): _drush_batch_worker() #7 /var/www/jb-inflatables/vendor/drush/drush/includes/batch.inc(99): _drush_batch_command('219') #8 /var/www/jb-inflatables/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(156): drush_batch_command('219') #9 [internal function]: Drush\Commands\core\UpdateDBCommands->process('219', Array) #10 /var/www/jb-inflatables/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array) #11 /var/www/jb-inflatables/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData)) #12 /var/www/jb-inflatables/vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData)) #13 /var/www/jb-inflatables/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData)) #14 /var/www/jb-inflatables/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #15 /var/www/jb-inflatables/vendor/symfony/console/Application.php(987): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #16 /var/www/jb-inflatables/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #17 /var/www/jb-inflatables/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #18 /var/www/jb-inflatables/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #19 /var/www/jb-inflatables/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput)) #20 /var/www/jb-inflatables/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array) #21 /var/www/jb-inflatables/vendor/drush/drush/includes/preflight.inc(18): require('/var/www/jb-inf...') #22 phar:///usr/local/bin/drush/bin/drush.php(141): drush_main() #23 /usr/local/bin/drush(10): require('phar:///usr/loc...') #24 {main}.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Layout builder 

Last updated 1 day ago

Created by

🇳🇱Netherlands meez

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France andrimont

    @ darko_antunovic

    I have the same issue on [error] Update aborted by: scheduler_content_moderation_integration_update_9002

    There is an issue report here but it leads to this thread that might not concern the cheduler_content_moderation_integration.

    I did apply the patch but same as well. Still cannot update scheduler_content_moderation_integration_update_9002.

  • 🇳🇿New Zealand quietone

    Updating the issue summary.

  • 🇩🇪Germany Grevil

    Static patch of current MR against 10.1.x.

  • 🇩🇰Denmark ressa Copenhagen

    I upgraded from Drupal 7 to Drupal 10, and got the error below when I saved the "Default" display. With @grevil's patch (thanks!) from #41 I could save and update order of fields.

    The website encountered an unexpected error. Try again later.
    Error: Call to a member function getConfigDependencyName() on null in Drupal\Core\Entity\EntityDisplayBase->calculateDependencies() (line 302 of core/lib/Drupal/Core/Entity/EntityDisplayBase.php).
    Drupal\Core\Config\Entity\ConfigEntityBase->preSave() (Line: 272)
    Drupal\Core\Entity\EntityDisplayBase->preSave() (Line: 528)
    Drupal\Core\Entity\EntityStorageBase->doPreSave() (Line: 483)
    Drupal\Core\Entity\EntityStorageBase->save() (Line: 257)
    [...]
    

    I still got these errors:

    Error message
    Warning: Undefined array key "teaser" in Drupal\field_ui\Form\EntityDisplayFormBase->saveDisplayStatuses() (line 883 of core/modules/field_ui/src/Form/EntityDisplayFormBase.php).
    
    Drupal\field_ui\Form\EntityDisplayFormBase->saveDisplayStatuses() (Line: 583)
    Drupal\field_ui\Form\EntityDisplayFormBase->submitForm()
    call_user_func_array() (Line: 129)
    Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 67)
    Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 597)
    Drupal\Core\Form\FormBuilder->processForm() (Line: 326)
    

    I deleted the "Teaser" view mode, but still got the errors ... So I re-created the "Teaser" View mode, and everything now seems to work. I even rolled back the patch, and I can now still update the previously failing "Default" view mode, with no errors, so it seems like the incomplete configuration was fixed.

Production build 0.71.5 2024