Unverified Commit 9483ed96 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3114017 by hash6, longwave, alexpott: Remove deprecated code from migrate module

parent 7c6f55e1
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -43,13 +43,8 @@ abstract class ComponentEntityDisplayBase extends DestinationBase implements Con
   * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository
   *   The entity display repository service.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityDisplayRepositoryInterface $entity_display_repository = NULL) {
  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityDisplayRepositoryInterface $entity_display_repository) {
    parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);

    if (!$entity_display_repository) {
      @trigger_error('The entity_display.repository service must be passed to PerComponentEntityDisplay::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/2835616.', E_USER_DEPRECATED);
      $entity_display_repository = \Drupal::service('entity_display.repository');
    }
    $this->entityDisplayRepository = $entity_display_repository;
  }

+0 −16
Original line number Diff line number Diff line
@@ -52,14 +52,6 @@ public function lookupSourceId(array $destination_id_values) {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function lookupDestinationId(array $source_id_values) {
    @trigger_error(__NAMESPACE__ . '\NullIdMap::lookupDestinationId() is deprecated in drupal:8.1.0 and is removed from drupal:9.0.0. Use Sql::lookupDestinationIds() instead. See https://www.drupal.org/node/2725809', E_USER_DEPRECATED);
    return [];
  }

  /**
   * {@inheritdoc}
   */
@@ -88,14 +80,6 @@ public function getMessages(array $source_id_values = [], $level = NULL) {
    return new \ArrayIterator([]);
  }

  /**
   * {@inheritdoc}
   */
  public function getMessageIterator(array $source_id_values = [], $level = NULL) {
    @trigger_error('getMessageIterator() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use getMessages() instead. See https://www.drupal.org/node/3060969', E_USER_DEPRECATED);
    return $this->getMessages($source_id_values, $level);
  }

  /**
   * {@inheritdoc}
   */
+0 −17
Original line number Diff line number Diff line
@@ -541,15 +541,6 @@ public function lookupSourceId(array $destination_id_values) {
    return $result->fetchAssoc() ?: [];
  }

  /**
   * {@inheritdoc}
   */
  public function lookupDestinationId(array $source_id_values) {
    @trigger_error(__NAMESPACE__ . '\Sql::lookupDestinationId() is deprecated in drupal:8.1.0 and is removed from drupal:9.0.0. Use Sql::lookupDestinationIds() instead. See https://www.drupal.org/node/2725809', E_USER_DEPRECATED);
    $results = $this->lookupDestinationIds($source_id_values);
    return $results ? reset($results) : [];
  }

  /**
   * {@inheritdoc}
   */
@@ -698,14 +689,6 @@ public function getMessages(array $source_id_values = [], $level = NULL) {
    return $query->execute();
  }

  /**
   * {@inheritdoc}
   */
  public function getMessageIterator(array $source_id_values = [], $level = NULL) {
    @trigger_error('getMessageIterator() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use getMessages() instead. See https://www.drupal.org/node/3060969', E_USER_DEPRECATED);
    return $this->getMessages($source_id_values, $level);
  }

  /**
   * {@inheritdoc}
   */
+0 −12
Original line number Diff line number Diff line
@@ -41,18 +41,6 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi
          $configuration['file_exists'] = FileSystemInterface::EXISTS_REPLACE;
      }
    }
    if (array_key_exists('reuse', $configuration)) {
      @trigger_error("Using the key 'reuse' is deprecated, use 'file_exists' => 'use existing' instead. See https://www.drupal.org/node/2981389.", E_USER_DEPRECATED);
      if (!empty($configuration['reuse'])) {
        $configuration['file_exists'] = FileSystemInterface::EXISTS_ERROR;
      }
    }
    if (array_key_exists('rename', $configuration)) {
      @trigger_error("Using the key 'rename' is deprecated, use 'file_exists' => 'rename' instead. See https://www.drupal.org/node/2981389.", E_USER_DEPRECATED);
      if (!empty($configuration['rename'])) {
        $configuration['file_exists'] = FileSystemInterface::EXISTS_RENAME;
      }
    }
    $configuration += ['file_exists' => FileSystemInterface::EXISTS_REPLACE];
    parent::__construct($configuration, $plugin_id, $plugin_definition);
  }
+4 −15
Original line number Diff line number Diff line
@@ -15,10 +15,6 @@
 * - from_format: The source format string as accepted by
 *   @link http://php.net/manual/datetime.createfromformat.php \DateTime::createFromFormat. @endlink
 * - to_format: The destination format.
 * - timezone: (deprecated) String identifying the required time zone, see
 *   DateTimePlus::__construct(). The timezone configuration key is deprecated
 *   in Drupal 8.4.x and will be removed before Drupal 9.0.0, use from_timezone
 *   and to_timezone instead.
 * - from_timezone: String identifying the required source time zone, see
 *   DateTimePlus::__construct().
 * - to_timezone: String identifying the required destination time zone, see
@@ -114,17 +110,10 @@ public function transform($value, MigrateExecutableInterface $migrate_executable

    $fromFormat = $this->configuration['from_format'];
    $toFormat = $this->configuration['to_format'];
    if (isset($this->configuration['timezone'])) {
      @trigger_error('Configuration key "timezone" is deprecated in 8.4.x and will be removed before Drupal 9.0.0, use "from_timezone" and "to_timezone" instead. See https://www.drupal.org/node/2885746', E_USER_DEPRECATED);
      $from_timezone = $this->configuration['timezone'];
      $to_timezone = isset($this->configuration['to_timezone']) ? $this->configuration['to_timezone'] : NULL;
    }
    else {
    $system_timezone = date_default_timezone_get();
    $default_timezone = !empty($system_timezone) ? $system_timezone : 'UTC';
    $from_timezone = isset($this->configuration['from_timezone']) ? $this->configuration['from_timezone'] : $default_timezone;
    $to_timezone = isset($this->configuration['to_timezone']) ? $this->configuration['to_timezone'] : $default_timezone;
    }
    $settings = isset($this->configuration['settings']) ? $this->configuration['settings'] : [];

    // Older versions of Drupal where omitting certain granularities (also known
Loading