When upgrading the database with drush after upgrading the code to DER 8.x-1.1 I get the following error

PHP Fatal error:  Call to a member function save() on null in /var/www/project/modules/contrib/dynamic_entity_reference/dynamic_entity_reference.post_update.php on line 21
PHP Stack trace:
PHP   1. {main}() /usr/local/lib/drush/drush.php:0
PHP   2. drush_main() /usr/local/lib/drush/drush.php:12
PHP   3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /usr/local/lib/drush/includes/preflight.inc:88
PHP   4. drush_dispatch() /usr/local/lib/drush/lib/Drush/Boot/BaseBoot.php:73
PHP   5. call_user_func_array:{/usr/local/lib/drush/includes/command.inc:185}() /usr/local/lib/drush/includes/command.inc:185
PHP   6. drush_command() /usr/local/lib/drush/includes/command.inc:185
PHP   7. _drush_invoke_hooks() /usr/local/lib/drush/includes/command.inc:217
PHP   8. call_user_func_array:{/usr/local/lib/drush/includes/command.inc:366}() /usr/local/lib/drush/includes/command.inc:366
PHP   9. drush_core_updatedb_batch_process() /usr/local/lib/drush/includes/command.inc:366
PHP  10. _update_batch_command() /usr/local/lib/drush/commands/core/core.drush.inc:1219
PHP  11. drush_batch_command() /usr/local/lib/drush/commands/core/drupal/update.inc:174
PHP  12. _drush_batch_command() /usr/local/lib/drush/includes/batch.inc:98
PHP  13. _drush_batch_worker() /usr/local/lib/drush/commands/core/drupal/batch.inc:111
PHP  14. call_user_func_array:{/usr/local/lib/drush/commands/core/drupal/batch.inc:163}() /usr/local/lib/drush/commands/core/drupal/batch.inc:163
PHP  15. update_invoke_post_update() /usr/local/lib/drush/commands/core/drupal/batch.inc:163
PHP  16. dynamic_entity_reference_post_update_field_storage_dependencies() /var/www/project/core/includes/update.inc:241
 [error]  Drush command terminated abnormally due to an unrecoverable error.
Error: Call to a member function save() on null in /var/www/project/modules/contrib/dynamic_entity_reference/dynamic_entity_reference.post_update.php, line 21 
 [error]  The external command could not be executed due to an application error. 
 [notice] Cache rebuild complete.
 [notice] Finished performing updates.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yichalal created an issue. See original summary.

jibran’s picture

Version: 8.x-1.1 » 8.x-1.x-dev
Status: Active » Needs review
FileSize
879 bytes

Thanks, for reporting the issue. Can you please try this patch?

Stijn Vanhandsaeme’s picture

Version: 8.x-1.x-dev » 8.x-1.1
Status: Needs review » Fixed

Jibran, works great. Thanks!

dpi’s picture

Status: Fixed » Active
jibran’s picture

Version: 8.x-1.1 » 8.x-1.x-dev
Status: Active » Needs review
zuzu83’s picture

@Jibran thanks

Andreas Radloff’s picture

Status: Needs review » Reviewed & tested by the community

This fixes the error for me.

dpi’s picture

This came up for one of my sites. Patch resolved errors.

  • jibran committed 2322fb2 on 8.x-1.x
    Issue #2851757 by jibran, Stijn Vanhandsaeme: Database upgrade fails
    
jibran’s picture

Status: Reviewed & tested by the community » Fixed

I think tests are broken but I committed it anyway.

jibran’s picture

I'll release a new tag once HEAD is green again.

Status: Fixed » Closed (fixed)

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