Created
April 14, 2016 16:42
-
-
Save juampynr/ecca1f3a4cece748f5f6a947eab2926c to your computer and use it in GitHub Desktop.
Patch for moment sandbox for https://www.drupal.org/node/1308152#comment-11087705
This file contains 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
diff --git a/moment.info.yml b/moment.info.yml | |
index 3f3d5be..89d4431 100644 | |
--- a/moment.info.yml | |
+++ b/moment.info.yml | |
@@ -2,6 +2,4 @@ name: Moment.js | |
description: 'Integrate Moment.js library into Drupal.' | |
package: Libraries | |
core: 8.x | |
-dependencies: | |
- - system_stream_wrapper | |
type: module | |
diff --git a/moment.install b/moment.install | |
index 4fa0309..64a46bf 100644 | |
--- a/moment.install | |
+++ b/moment.install | |
@@ -21,7 +21,10 @@ function moment_requirements($phase) { | |
$library = $d->getLibraryByName('moment', $name); | |
$severity = REQUIREMENT_OK; | |
foreach ($library['js'] as $js) { | |
- if (!file_exists($js['data'])) { | |
+ try { | |
+ file_exists($js['data']); | |
+ } | |
+ catch (\InvalidArgumentException $e) { | |
$severity = REQUIREMENT_ERROR; | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment