Problem/Motivation

Without at least one hook_update_dependencies() implementation, database updates run in non-deterministic order. This is a problem for media_entity_update_8201, which tries to alter database columns in the media_revision table. The columns may not exist by the time the update hook runs, since they are created by system_update_8400. This can cause database schema exceptions that totally break the update path.

Proposed resolution

Implement hook_update_dependencies() to ensure that media_entity_update_8201 runs after system_update_8400.

Remaining tasks

Patch, review, commit, sigh of relief.

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#6 2916839-6.patch1.18 KBphenaproxima
#3 2916839-3.patch1.74 KBphenaproxima

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Issue summary: View changes

Updating the IS a bit.

phenaproxima’s picture

Status: Active » Needs review
StatusFileSize
new1.74 KB

Okay, friends...

phenaproxima’s picture

Priority: Normal » Critical

Bumping priority to critical, since this blocks the update path.

seanb’s picture

Looks good to me. We could probably remove the change below.

+++ b/media_entity.install
@@ -479,3 +479,17 @@ function _media_entity_snapshot_config(array $names, $delete = FALSE) {
+  $dependencies['media_entity'][8201]['system'] = 8400;

This is fixed by #2916788-9: system_update_8402 does not affect media entities

phenaproxima’s picture

StatusFileSize
new1.18 KB

Agreed. How does this look?

seanb’s picture

Status: Needs review » Reviewed & tested by the community

Perfect!

  • phenaproxima authored c564fc4 on 8.x-2.x
    Issue #2916839 by phenaproxima, seanB: Update path may try to alter...
phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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