Uh oh!
There was an error while loading. Please reload this page.
Add a check for Libraries API module and warn users about the dependency being dropped - #671
Add a check for Libraries API module and warn users about the dependency being dropped#671kdruckman wants to merge 19 commits into
Conversation
Alerts users of Libraries API dependencies.
phenaproxima
left a comment
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
phenaproxima
commented
Mar 6, 2020
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. |
| $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.
We can remove a level of nesting here by using array_intersect(), like so:
foreach ($enabled_modulesas$module => $info) {
if (array_intersect($info['dependencies'], ['libraries:libraries', 'libraries'])) {
$libraries_dependencies[$module] = $info['name'];
}
}There was a problem hiding this comment.
yes, much better, thanks!
| } | ||
| } | ||
| if ($enabled_modules) { |
There was a problem hiding this comment.
This should be if ($libraries_dependencies). :)
Uh oh!
There was an error while loading. Please reload this page.
No description provided.