Commit 3a004ac4 authored by Joshua Sedler's avatar Joshua Sedler 🤸🏼 Committed by Julian Pustkuchen
Browse files

Issue #3269497 by Grevil, Anybody: Fix composer require failure due to npm-asset

parent 9a4e101a
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -11,6 +11,25 @@
    "source": "http://cgit.drupalcode.org/drowl_media"
  },
  "suggest": {
    "npm-asset/drowl-admin-iconset": "REQUIRED DROWL Admin Iconset. Do not forget to require this until https://www.drupal.org/project/drowl_media/issues/3269497 is solved."
    "npm-asset/drowl-admin-iconset": "Required to use drupal/drowl_media. Expected version: ^1.0"
  },
  "require": {
    "drupal/blazy":">=2.9",
    "drupal/crop":">=2.2",
    "drupal/embed":">=1.4",
    "drupal/entity_browser":">=2.6",
    "drupal/entity_embed":">=1.2",
    "drupal/media_entity_file_replace":">=1",
    "drupal/fences":">=2.0",
    "drupal/field_group":">=3.2",
    "drupal/focal_point":">=1.5",
    "drupal/inline_entity_form":">=1.0",
    "drupal/metatag":">=1.19",
    "drupal/pathauto":">=1.9",
    "drupal/rabbit_hole":">=1.0",
    "drupal/smart_trim":">=1.3",
    "drupal/views_linkarea":">=1.3",
    "drupal/viewsreference":">=1.7",
    "drupal/dropzonejs":">=2.6"
  }
}
+16 −0
Original line number Diff line number Diff line
@@ -13,6 +13,22 @@ use Drupal\Core\Extension\MissingDependencyException;
function drowl_media_requirements($phase) {
  $requirements = [];

  if ($phase == 'runtime') {
    $drowlAdminIconsetLibrary = \Drupal::service('library.discovery')->getLibraryByName('drowl_media', 'admin_iconset');

    if (empty($drowlAdminIconsetLibrary)) {
      throw new Exception("Required libraries for the drowl_media module are not defined in the appropriate libraries.yml file.");
    }

    $drowlAdminIconseExist = file_exists(DRUPAL_ROOT . '/' . $drowlAdminIconsetLibrary['css'][0]['data']);

    $requirements['drowl_admin_iconset'] = [
      'title' => t('DROWL Media: Missing Drowl Admin Iconset library'),
      'value' => $drowlAdminIconseExist ? t('Installed') : t('Not installed'),
      'description' => $drowlAdminIconseExist ? '' : t('To use the drowl_media module, the drowl admin iconset library needs to be required via composer, using "composer require npm-asset/drowl-admin-iconset". NOTE, that you need to set up the "asset-packagist" repository in your projects composer.json file.<br>See <a href="https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies#third-party-libraries">here</a> on how to do it.'),
      'severity' => $drowlAdminIconseExist ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    ];
  }
  // This branch of drowl_media shouldn't be used with core < 8.4.x or with
  // media_entity 1.x enabled.
  $drupal_version = explode('.', \Drupal::VERSION);