Skip to content
Snippets Groups Projects
Commit 43c51fb0 authored by André Matheus Pedrosa's avatar André Matheus Pedrosa Committed by Joseph Olstad
Browse files

Issue #3256961 by urvashi_vora, andregp, tmaiochi: Throw an exception on...

Issue #3256961 by urvashi_vora, andregp, tmaiochi: Throw an exception on LocalRemoteAssetTrait.php function
parent 5166d421
Branches 2.1.x
Tags 2.1.0
1 merge request!20Issue #3256949 by urvashi_vora, andregp, tmaiochi, joseph.olstad: Validate...
...@@ -42,8 +42,8 @@ trait LocalRemoteAssetTrait { ...@@ -42,8 +42,8 @@ trait LocalRemoteAssetTrait {
/** @var \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface|\Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface $this */ /** @var \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface|\Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface $this */
if ($this->isInstalled()) { if ($this->isInstalled()) {
// LocalLibraryInterface::getLocalPath() returns the path relative to the // LocalLibraryInterface::getLocalPath() returns the path relative to the
// app root. In order for the core core asset system to register the path // app root. In order for the core asset system to register the path as
// as relative to the app root, a leading slash is required. // relative to the app root, a leading slash is required.
/** @see \Drupal\Core\Asset\LibraryDiscoveryParser::buildByExtension() */ /** @see \Drupal\Core\Asset\LibraryDiscoveryParser::buildByExtension() */
return '/' . $this->getLocalPath(); return '/' . $this->getLocalPath();
} }
...@@ -51,7 +51,9 @@ trait LocalRemoteAssetTrait { ...@@ -51,7 +51,9 @@ trait LocalRemoteAssetTrait {
return $this->getRemoteUrl(); return $this->getRemoteUrl();
} }
else { else {
// @todo Throw an exception. throw new \Exception(
"Library path isn't set and library doesn't have remote url."
);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment