Commit 8a34ef89 authored by Ev Maslovskiy's avatar Ev Maslovskiy Committed by Nedjo Rogers
Browse files

Issue #3297177 by Spleshka, Project Update Bot, nedjo: Automated Drupal 10 compatibility fixes

parent e0217cdb
Loading
Loading
Loading
Loading

drush/features.drush8.inc

deleted100644 → 0
+0 −907

File deleted.

Preview size limit exceeded, changes collapsed.

+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ services:
      - [initFeaturesManager]
  features.manager:
    class: Drupal\features\FeaturesManager
    arguments: ['%app.root%', '@entity_type.manager', '@config.factory', '@config.storage', '@config.manager', '@module_handler', '@features.config_update', '@extension.list.module']
    arguments: ['%app.root%', '@entity_type.manager', '@config.factory', '@config.storage', '@config.manager', '@module_handler', '@features.config_update', '@extension.list.module', '@extension.path.resolver']

  features.config_update:
    class: Drupal\config_update\ConfigReverter
@@ -25,11 +25,11 @@ services:

  features.extension_storage:
    class: Drupal\features\FeaturesInstallStorage
    arguments: ['@config.storage']
    arguments: ['@config.storage', '@extension.path.resolver']

  features.extension_optional_storage:
    class: Drupal\features\FeaturesInstallStorage
    arguments: ['@config.storage', 'config/optional']
    arguments: ['@config.storage', '@extension.path.resolver', 'config/optional']

  features.config.installer:
    class: Drupal\features\FeaturesConfigInstaller
+1 −1
Original line number Diff line number Diff line
@@ -259,8 +259,8 @@ class FeaturesAssigner implements FeaturesAssignerInterface {
   */
  public function setCurrent(FeaturesBundleInterface $bundle) {
    $this->currentBundle = $bundle;
    if (\Drupal::request()->hasSession()) {
      $session = \Drupal::request()->getSession();
    if (isset($session)) {
      $session->set('features_current_bundle', $bundle->getMachineName());
    }
    return $bundle;
+13 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Drupal\features;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ExtensionPathResolver;

/**
 * Wraps FeaturesInstallStorage to support multiple configuration directories.
@@ -18,6 +19,13 @@ class FeaturesExtensionStorages implements FeaturesExtensionStoragesInterface {
   */
  protected $configStorage;

  /**
   * Instance of the extension path resolver service.
   *
   * @var \Drupal\Core\Extension\ExtensionPathResolver
   */
  protected ExtensionPathResolver $extensionPathResolver;

  /**
   * The extension storages.
   *
@@ -37,9 +45,12 @@ class FeaturesExtensionStorages implements FeaturesExtensionStoragesInterface {
   *
   * @param \Drupal\Core\Config\StorageInterface $config_storage
   *   The configuration storage.
   * @param \Drupal\Core\Extension\ExtensionPathResolver $extension_path_resolver
   *   Instance of the extension path resolver service.
   */
  public function __construct(StorageInterface $config_storage) {
  public function __construct(StorageInterface $config_storage, ExtensionPathResolver $extension_path_resolver) {
    $this->configStorage = $config_storage;
    $this->extensionPathResolver = $extension_path_resolver;
  }

  /**
@@ -53,7 +64,7 @@ class FeaturesExtensionStorages implements FeaturesExtensionStoragesInterface {
   * {@inheritdoc}
   */
  public function addStorage($directory = InstallStorage::CONFIG_INSTALL_DIRECTORY) {
    $this->extensionStorages[$directory] = new FeaturesInstallStorage($this->configStorage, $directory);
    $this->extensionStorages[$directory] = new FeaturesInstallStorage($this->configStorage, $this->extensionPathResolver, $directory);
    $this->reset();
  }

+13 −2
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Drupal\features;

use Drupal\Core\Extension\ExtensionPathResolver;
use Drupal\Core\Site\Settings;
use Drupal\Core\Config\ExtensionInstallStorage;
use Drupal\Core\Config\StorageInterface;
@@ -19,6 +20,13 @@ use Drupal\Core\Extension\ExtensionDiscovery;
 */
class FeaturesInstallStorage extends ExtensionInstallStorage {

  /**
   * Instance of the extension path resolver service.
   *
   * @var \Drupal\Core\Extension\ExtensionPathResolver
   */
  protected ExtensionPathResolver $extensionPathResolver;

  /**
   * Overrides \Drupal\Core\Config\ExtensionInstallStorage::__construct().
   *
@@ -27,6 +35,8 @@ class FeaturesInstallStorage extends ExtensionInstallStorage {
   * @param \Drupal\Core\Config\StorageInterface $config_storage
   *   The active configuration store where the list of enabled modules and
   *   themes is stored.
   * @param \Drupal\Core\Extension\ExtensionPathResolver $extension_path_resolver
   *   Instance of the extension path resolver service.
   * @param string $directory
   *   The directory to scan in each extension to scan for files. Defaults to
   *   'config/install'. This parameter will be mandatory in Drupal 9.0.0.
@@ -41,7 +51,8 @@ class FeaturesInstallStorage extends ExtensionInstallStorage {
   *   (optional) The current installation profile. This parameter will be
   *   mandatory in Drupal 9.0.0.
   */
  public function __construct(StorageInterface $config_storage, $directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION, $include_profile = TRUE, $profile = NULL) {
  public function __construct(StorageInterface $config_storage, ExtensionPathResolver $extension_path_resolver, $directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION, $include_profile = TRUE, $profile = NULL) {
    $this->extensionPathResolver = $extension_path_resolver;
    // @todo: determine if we should be setting $include_profile to FALSE.
    parent::__construct($config_storage, $directory, $collection, FALSE, $profile);
  }
@@ -113,7 +124,7 @@ class FeaturesInstallStorage extends ExtensionInstallStorage {
          // file location so we can use drupal_get_path() on the active profile
          // during the module scan.
          // @todo Remove as part of https://www.drupal.org/node/2186491
          drupal_get_filename('profile', $profile, $profile_list[$profile]->getPathname());
          $this->extensionPathResolver->getPathname('profile', $profile);
        }
        // CHANGED START: Put Features modules first in list returned.
        // to allow features to override config provided by other extensions.
Loading