Commit eb0c099d authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3178187 by sker101: Error "TypeError: Argument 1 passed to...

Issue #3178187 by sker101: Error "TypeError: Argument 1 passed to Drupal\upgrade_status\DeprecationMessage::setFile() must be of the type string, null given"
parent 7bca01f0
...@@ -135,12 +135,12 @@ final class LibraryDeprecationAnalyzer { ...@@ -135,12 +135,12 @@ final class LibraryDeprecationAnalyzer {
}); });
$deprecations = []; $deprecations = [];
$file = sprintf('%s/%s.libraries.yml', $extension->getPath(), $extension->getName());
foreach ($libraries_with_dependencies as $key => $library_with_dependency) { foreach ($libraries_with_dependencies as $key => $library_with_dependency) {
foreach ($library_with_dependency['dependencies'] as $dependency) { foreach ($library_with_dependency['dependencies'] as $dependency) {
$is_deprecated = $this->isLibraryDeprecated($dependency); $is_deprecated = $this->isLibraryDeprecated($dependency);
if (is_null($is_deprecated)) { if (is_null($is_deprecated)) {
$message = sprintf("The '%s' library (a dependency of '%s') is not defined because the defining extension is not installed. Cannot decide if it is deprecated or not.", $dependency, $key); $message = sprintf("The '%s' library (a dependency of '%s') is not defined because the defining extension is not installed. Cannot decide if it is deprecated or not.", $dependency, $key);
$file = sprintf('%s/%s.libraries.yml', $extension->getPath(), $extension->getName());
$deprecations[] = new DeprecationMessage($message, $file, 0); $deprecations[] = new DeprecationMessage($message, $file, 0);
} }
elseif (!empty($is_deprecated)) { elseif (!empty($is_deprecated)) {
...@@ -150,7 +150,6 @@ final class LibraryDeprecationAnalyzer { ...@@ -150,7 +150,6 @@ final class LibraryDeprecationAnalyzer {
} }
else { else {
$message = sprintf("The '%s' library is depending on a deprecated library. %s", $key, $is_deprecated); $message = sprintf("The '%s' library is depending on a deprecated library. %s", $key, $is_deprecated);
$file = sprintf('%s/%s.libraries.yml', $extension->getPath(), $extension->getName());
$deprecations[] = new DeprecationMessage($message, $file, 0); $deprecations[] = new DeprecationMessage($message, $file, 0);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment