This repository was archived by the owner on Nov 16, 2021. It is now read-only.
Add a check for Libraries API module and warn users about the dependency being dropped#671
Open
kdruckman wants to merge 19 commits intoacquia:8.x-4.xfrom
Open
Add a check for Libraries API module and warn users about the dependency being dropped#671kdruckman wants to merge 19 commits intoacquia:8.x-4.xfrom
kdruckman wants to merge 19 commits intoacquia:8.x-4.xfrom
Conversation
Alerts users of Libraries API dependencies.
phenaproxima
suggested changes
Mar 5, 2020
Collaborator
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?
Collaborator
|
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. |
phenaproxima
suggested changes
Mar 6, 2020
lightning.install
Outdated
| $enabled_modules = \Drupal::service('extension.list.module')->getAllInstalledInfo(); | ||
|
|
||
| foreach ($enabled_modules as $module => $info) { | ||
| foreach (['libraries:libraries', 'libraries'] as $needle) { |
Collaborator
There was a problem hiding this comment.
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'];
}
}
Contributor
Author
There was a problem hiding this comment.
yes, much better, thanks!
lightning.install
Outdated
| } | ||
| } | ||
|
|
||
| if ($enabled_modules) { |
Collaborator
There was a problem hiding this comment.
This should be if ($libraries_dependencies). :)
Contributor
Author
There was a problem hiding this comment.
doh! Yes it should.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.