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 99cb949215..fcc2aad125 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php @@ -100,7 +100,6 @@ private function willBeIsolated($test) { public static function getSkippedDeprecations() { return [ '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.',