You are here

function lightning_media_image_update_8002 in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.4 modules/lightning_media_image/lightning_media_image.install \lightning_media_image_update_8002()
  2. 8 modules/lightning_media_image/lightning_media_image.install \lightning_media_image_update_8002()
  3. 8.2 modules/lightning_media_image/lightning_media_image.install \lightning_media_image_update_8002()

Installs the image_browser entity browser.

File

modules/lightning_media_image/lightning_media_image.install, line 81
Contains install and update routines for Lightning Media Image.

Code

function lightning_media_image_update_8002() {

  // A widget validation service was added to Entity Browser after alpha6, and
  // it will almost certainly be instantiated by the widget plugins during the
  // creation of a new entity browser.
  try {
    \Drupal::service('plugin.manager.entity_browser.widget_validation');
  } catch (ServiceNotFoundException $e) {

    // Rebuild the container to ensure the widget validation service exists.
    lightning_core_rebuild_container();
  }
  Config::forModule('lightning_media_image')
    ->getEntity('entity_browser', 'image_browser')
    ->save();
}