diff --git a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php index 9103ab8c07..5241ff3a19 100644 --- a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php +++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php @@ -58,9 +58,14 @@ public function __construct(StorageInterface $config_storage, $directory = self: $this->configStorage = $config_storage; $this->includeProfile = $include_profile; if (is_null($profile)) { - @trigger_error('Install profile will be a mandatory parameter in Drupal 9.0.', E_USER_DEPRECATED); + $profile = \Drupal::installProfile(); + if (!is_null($profile)) { + // Only trigger deprecation if \Drupal::installProfile() is not also + // NULL. + @trigger_error('Install profile will be a mandatory parameter in Drupal 9.0.', E_USER_DEPRECATED); + } } - $this->installProfile = $profile ?: \Drupal::installProfile(); + $this->installProfile = $profile; } /** diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php index d96193e455..d437b73793 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php @@ -103,7 +103,6 @@ public static function getSkippedDeprecations() { 'Symfony\Component\HttpKernel\Controller\ControllerResolver::getArguments is deprecated as of 3.1 and will be removed in 4.0. Implement the Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface and inject it in the HttpKernel instead.', 'The Twig_Node::getLine method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateLine() instead.', 'The Twig_Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', - 'Install profile will be a mandatory parameter in Drupal 9.0.', 'Setting the strict option of the Choice constraint to false is deprecated since version 3.2 and will be removed in 4.0.', 'The revision_user revision metadata key is not set.', 'The revision_created revision metadata key is not set.',