Skip to content

Instantly share code, notes, and snippets.

@kimpepper
Last active December 14, 2017 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimpepper/66772eca4725e0627b451da755a0eaa4 to your computer and use it in GitHub Desktop.
Save kimpepper/66772eca4725e0627b451da755a0eaa4 to your computer and use it in GitHub Desktop.
Core Media Update notes

Upgrading to core media

Import media styles

Update fails if core media styles don't exist.

drush config-import --partial --source=/data/app/core/modules/image/config/install/ -y

Patches

"drupal/entity_browser": {
  "Fix single selection on view widget": "https://www.drupal.org/files/issues/2845941-8.patch",
  "Cannot upgrade with Drush 9": "https://www.drupal.org/files/issues/2927347-2.patch"
},
"drupal/svg_icon": {
  "Media support": "https://www.drupal.org/files/issues/2888672-3.patch"
}

Delete conflicting config

FIXME this just creates issues further down.

drush cdel field.storage.media.field_media_image
drush cdel field.field.media.image.field_media_image

Composer install

composer require \
  drupal/entity_browser:~2.0 \
  drupal/media_entity:2.x-dev \
  drupal/media_entity_actions:~1.0 \
  drupal/media_entity_browser:~2.0 \
  drupal/media_entity_document:~1.1 \
  drupal/media_entity_image:~1.2 \
  drupal/svg_icon:~1.0 \
  drupal/video_embed_field:~2.0 \
  --update-with-dependencies

Update config keys

  • Find replace media_entity.bundle with media.type

Update the database

drush updb

Export config

drush cexy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment