-
Notifications
You must be signed in to change notification settings - Fork 102
Add a check for Libraries API module and warn users about the dependency being dropped #671
base: 8.x-4.x
Are you sure you want to change the base?
Conversation
Alerts users of Libraries API dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely what I was imagining! Nice work!! In addition to these changes, can we also add drupal/libraries:^3.0
as an explicit dependency to Lightning's composer.json?
This looks pretty damn great! Since we've decided that Lightning Media will be the thing to deprecate and remove this dependency, let's close this PR and reconstitute it against Lightning Media 3.x. |
lightning.install
Outdated
$enabled_modules = \Drupal::service('extension.list.module')->getAllInstalledInfo(); | ||
|
||
foreach ($enabled_modules as $module => $info) { | ||
foreach (['libraries:libraries', 'libraries'] as $needle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove a level of nesting here by using array_intersect(), like so:
foreach ($enabled_modules as $module => $info) {
if (array_intersect($info['dependencies'], ['libraries:libraries', 'libraries'])) {
$libraries_dependencies[$module] = $info['name'];
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, much better, thanks!
lightning.install
Outdated
} | ||
} | ||
|
||
if ($enabled_modules) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be if ($libraries_dependencies)
. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh! Yes it should.
No description provided.