Commit 471ab490 authored by quietone's avatar quietone
Browse files

Issue #3202921 by quietone: Remove dead code left when converting to FieldDiscovery

parent 06511083
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -72,7 +72,6 @@ class OrderItemDeriver extends DeriverBase implements ContainerDeriverInterface
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    // @todo Convert to new trait. See https://www.drupal.org/node/2951550.
    $order_item_types = static::getSourcePlugin('commerce1_order_item_type');
    try {
      $order_item_types->checkRequirements();
@@ -84,24 +83,6 @@ class OrderItemDeriver extends DeriverBase implements ContainerDeriverInterface
      return parent::getDerivativeDefinitions($base_plugin_definition);
    }

    $fields = [];
    try {
      $source_plugin = static::getSourcePlugin('d7_field_instance');
      $source_plugin->checkRequirements();

      // Read all field instance definitions in the source database.
      foreach ($source_plugin as $row) {
        if ($row->getSourceProperty('entity_type') == 'commerce_line_item') {
          $fields[$row->getSourceProperty('bundle')][$row->getSourceProperty('field_name')] = $row->getSource();
        }
      }
    }
    catch (RequirementsException $e) {
      // If checkRequirements() failed then the field module did not exist and
      // we do not have any fields. Therefore, $fields will be empty and below
      // we'll create a migration just for the line item properties.
    }

    try {
      foreach ($order_item_types as $row) {
        $line_item_type = $row->getSourceProperty('type');
+0 −18
Original line number Diff line number Diff line
@@ -83,24 +83,6 @@ class ProductDeriver extends DeriverBase implements ContainerDeriverInterface {
      return $this->derivatives;
    }

    $fields = [];
    try {
      $source_plugin = static::getSourcePlugin('d7_field_instance');
      $source_plugin->checkRequirements();

      // Read all field instance definitions in the source database.
      foreach ($source_plugin as $row) {
        if ($row->getSourceProperty('entity_type') == 'node') {
          $fields[$row->getSourceProperty('bundle')][$row->getSourceProperty('field_name')] = $row->getSource();
        }
      }
    }
    catch (RequirementsException $e) {
      // If checkRequirements() failed then the field module did not exist and
      // we do not have any fields. Therefore, $fields will be empty and below
      // we'll create a migration just for the product properties.
    }

    try {
      foreach ($product_types as $row) {
        $product_type = $row->getSourceProperty('type');
+0 −18
Original line number Diff line number Diff line
@@ -82,24 +82,6 @@ class ProductVariationDeriver extends DeriverBase implements ContainerDeriverInt
      return $this->derivatives;
    }

    $fields = [];
    try {
      $source_plugin = static::getSourcePlugin('d7_field_instance');
      $source_plugin->checkRequirements();

      // Read all field instance definitions in the source database.
      foreach ($source_plugin as $row) {
        if ($row->getSourceProperty('entity_type') == 'commerce_product') {
          $fields[$row->getSourceProperty('bundle')][$row->getSourceProperty('field_name')] = $row->getSource();
        }
      }
    }
    catch (RequirementsException $e) {
      // If checkRequirements() failed then the field module did not exist and
      // we do not have any fields. Therefore, $fields will be empty and below
      // we'll create a migration just for the node properties.
    }

    try {
      foreach ($product_variation_types as $row) {
        $product_variation_type = $row->getSourceProperty('type');
+0 −18
Original line number Diff line number Diff line
@@ -83,24 +83,6 @@ class ProfileDeriver extends DeriverBase implements ContainerDeriverInterface {
      return $this->derivatives;
    }

    $fields = [];
    try {
      $source_plugin = static::getSourcePlugin('d7_field_instance');
      $source_plugin->checkRequirements();

      // Read all field instance definitions in the source database.
      foreach ($source_plugin as $row) {
        if ($row->getSourceProperty('entity_type') == 'commerce_customer_profile') {
          $fields[$row->getSourceProperty('bundle')][$row->getSourceProperty('field_name')] = $row->getSource();
        }
      }
    }
    catch (RequirementsException $e) {
      // If checkRequirements() failed then the field module did not exist and
      // we do not have any fields. Therefore, $fields will be empty and below
      // we'll create a migration just for the profile properties.
    }

    try {
      foreach ($profile_types as $row) {
        $profile_type = $row->getSourceProperty('type');