Mercurial > hg > isophonics-drupal-site
diff core/modules/image/image.post_update.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 129ea1e6d783 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/image/image.post_update.php Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,22 @@ +<?php + +/** + * @file + * Post-update functions for Image. + */ + +use Drupal\Core\Entity\Entity\EntityViewDisplay; +use Drupal\Core\Entity\Entity\EntityFormDisplay; + +/** + * Saves the image style dependencies into form and view display entities. + */ +function image_post_update_image_style_dependencies() { + // Merge view and form displays. Use array_values() to avoid key collisions. + $displays = array_merge(array_values(EntityViewDisplay::loadMultiple()), array_values(EntityFormDisplay::loadMultiple())); + /** @var \Drupal\Core\Entity\Display\EntityDisplayInterface[] $displays */ + foreach ($displays as $display) { + // Re-save each config entity to add missed dependencies. + $display->save(); + } +}