Problem/Motivation

cckfield plugins were introduced to make migrating cck fields easier but we're now using the same plugin type for D7 fields as well.

This is confusing for developers as 'CCK' was primarily a Drupal 6 concept whereas Drupal 7 had the same functionality in core under the name 'Field'.

Proposed resolution

Rename the plugin type to 'FieldPluginBase' as suggested in #2631736: Cckfield Plugins must distinguish core versions to make it less confusing.
Introduce a backwards compatibility layer for 'CckFieldPluginBase' so that classes that extend that base class don't stop working.

Remaining tasks

The patch in #112 has become too unwieldy to review, so we will split the patch in two:

  1. The conversion of the CckFieldPuginBase class to just FieldPluginBase, BC layer and required changes to the core migrations using the CCK field plugins. A single conversion a class extending the CckFieldPluginBase.
  2. All the other conversions of classes extending CckFieldPluginBase and their unit tests. This will be reviewed and handled in a follow-up issue. See follow-up: #2833206: Convert Migrate's cckfield plugins to use the new field plugins
  • The split is now accomplished. The patch was shrunk by 30kb as a result and now has only the *necessary* changes.
  • Review of the patch is also accomplished. Now all that is left is to commit the patch.

User interface changes

None.

API changes

No API breaks but two deprecations:

  • Deprecated the CckFieldPluginBase class, and add a new FieldPluginBase class.
  • Deprecate plugin manager class 'plugin.manager.migrate.cckfield', add 'plugin.manager.migrate.field' service.

Data model changes

None.

CommentFileSizeAuthor
#172 interdiff-169-172.txt5.15 KBjofitz
#172 2683435-172-with-link.patch74.99 KBjofitz
#169 interdiff-162-169.txt1.82 KBjofitz
#169 2683435-169-with-link.patch74.63 KBjofitz
#162 interdiff-158-162.txt2.61 KBjofitz
#162 2683435-162-with-link.patch74.49 KBjofitz
#160 withlinkinterdif.txt10.71 KBPavan B S
#160 drupal-2683435-160-with-link.patch81.25 KBPavan B S
#159 interdiff.txt1.18 KBquietone
#159 drupal-2683435-158-with-link.patch74.5 KBquietone
#155 interdiff.txt15.94 KBquietone
#155 drupal-2683435-154-with-link.patch74.51 KBquietone
#151 interdiff.txt1.12 KBquietone
#151 drupal-2683435-151-with-link.patch69.3 KBquietone
#149 drupal-2683435-149-with-link.patch68.79 KBjofitz
#145 interdiff-143-145.txt8.28 KBquietone
#145 drupal-2683435-145-with-link.patch69.3 KBquietone
#143 interdiff-141-143.patch4.21 KBquietone
#143 drupal-2683435-143-no-conversions.patch59.79 KBquietone
#142 interdiff-141-142.txt8.28 KBjofitz
#142 drupal-2683435-142-with-link.patch72.21 KBjofitz
#141 interdiff-138-141.txt1.24 KBjofitz
#141 drupal-2683435-141-no-conversions.patch62.7 KBjofitz
#138 interdiff-130-138.txt8.09 KBquietone
#138 drupal-2683435-138-no-conversions.patch62.69 KBquietone
#135 interdiff.txt449 bytesquietone
#135 drupal-2683435-135-with-link.patch72.45 KBquietone
#133 interdiff.txt8.59 KBquietone
#133 drupal-2683435-133-with-link.patch71.85 KBquietone
#131 interdiff.txt7.78 KBquietone
#131 drupal-2683435-131-with-link.patch70.21 KBquietone
#130 drupal-2683435-130-no-conversions.patch61.86 KBquietone
#128 interdiff-127-128.txt18.94 KBjofitz
#128 drupal-2683435-128-no-conversions.patch61.67 KBjofitz
#127 interdiff-124-127.txt5.98 KBjofitz
#127 drupal-2683435-127-no-conversions.patch42.73 KBjofitz
#125 interdiff-120-124.txt27.08 KBjofitz
#124 drupal-2683435-124-no-conversions.patch43.21 KBjofitz
#120 drupal-2683435-120-imagefield-conversion.patch68.13 KBsteven jones
#120 drupal-2683435-120-no-conversions.patch66.8 KBsteven jones
#112 interdiff.txt3.91 KBquietone
#112 2683435-112.patch95.14 KBquietone
#107 2683435-107.patch91.08 KBsteven jones
#105 2683435-105.patch90.1 KBsteven jones
#102 2683435-102.patch89.89 KBsteven jones
#99 interdiff.txt16.28 KBquietone
#99 2683435-99.patch84.45 KBquietone
#98 interdiff.txt15.45 KBquietone
#98 2683435-98.patch89.79 KBquietone
#93 2683435-93.patch91.64 KBquietone
#90 2683435-90.patch96.75 KBphenaproxima
#88 2683435-88.patch20.16 KBprashant.c
#83 2683435-83.patch89.92 KBphenaproxima
#81 78-80-interdiff.txt2.5 KBalexpott
#81 2683435-phena-80.patch88.75 KBalexpott
#80 2683435-80.patch115.63 KBphenaproxima
#78 2683435-2-78.patch86.97 KBalexpott
#78 74-78-interdiff.txt13.97 KBalexpott
#74 2683435-2-74.patch86.43 KBsam152
#74 73-74-interdiff.txt826 bytessam152
#73 2683435-2-73.patch86.43 KBalexpott
#73 63-73-interdiff.txt1.25 KBalexpott
#63 55-63-interdiff.txt2.97 KBalexpott
#63 2683435-63.patch85.93 KBalexpott
#61 2683435-61.patch113.35 KBmichael_wojcik
#55 consider_renaming-2683435-55.patch91.83 KBmikeryan
#54 interdiff.txt1.07 KBmikeryan
#54 consider_renaming-2683435-54.patch739 bytesmikeryan
#48 consider_renaming-2683435-48.patch91.52 KBhussainweb
#48 interdiff-46-48.txt3.74 KBhussainweb
#46 consider_renaming-2683435-46.patch95.42 KBhussainweb
#46 interdiff-44-46.txt624 byteshussainweb
#44 consider_renaming-2683435-44.patch95.36 KBhussainweb
#42 consider_renaming-2683435-42.patch89.41 KBhussainweb
#39 consider_renaming-2683435-39.patch89.68 KBhussainweb
#39 interdiff-38-39.txt5.06 KBhussainweb
#38 consider_renaming-2683435-38.patch83.45 KBhussainweb
#38 interdiff-36-38.txt3.58 KBhussainweb
#36 consider_renaming-2683435-36.patch89.53 KBhussainweb
#36 interdiff-33-36.txt2.12 KBhussainweb
#33 interdiff-29-33.txt988 bytesquietone
#33 consider_renaming-2683435-33.patch106.65 KBquietone
#31 interdiff.txt6.69 KBquietone
#31 consider_renaming-2683435-31.patch108.89 KBquietone
#29 interdiff.txt1.56 KBquietone
#29 consider_renaming-2683435-29.patch106.65 KBquietone
#27 consider_renaming-2683435-27.patch104.79 KBquietone
#17 consider_renaming-2683435-17.patch104.64 KBmikeryan
#16 consider_renaming-2683435-16.patch88.39 KBmikeryan
#12 consider_renaming-2683435-12.patch82.59 KBmikeryan
#8 interdiff.txt738 bytesmikeryan
#8 consider_renaming-2683435-8.patch57.46 KBmikeryan
#6 consider_renaming-2683435-6.patch57.47 KBmikeryan

Comments

benjy created an issue. See original summary.

mikeryan’s picture

mikeryan’s picture

Version: 8.1.x-dev » 8.2.x-dev
mikeryan’s picture

Status: Active » Postponed
Related issues: +#2631736: Cckfield Plugins must distinguish core versions

This would disrupt #2631736: Cckfield Plugins must distinguish core versions, which is clearly more important, so let's not try to do this until that is committed.

mikeryan’s picture

Status: Postponed » Active

Unblocked.

mikeryan’s picture

Status: Active » Needs review
StatusFileSize
new57.47 KB

Renaming stuff makes for a nice mindless Friday-afternoon task... The basic algorithm was to remove "CCK" wherever it appeared next to "field", and otherwise replace it with "field".

Status: Needs review » Needs work

The last submitted patch, 6: consider_renaming-2683435-6.patch, failed testing.

mikeryan’s picture

Status: Needs work » Needs review
StatusFileSize
new57.46 KB
new738 bytes

Missed one file rename...

benjy’s picture

Probably need a change record here, going to break any contrib modules that have migration paths but I don't think there are many anyway.

vasi’s picture

Issue tags: +Needs change record
mikeryan’s picture

Status: Needs review » Needs work

I'd like to add a BC layer where possible (deprecated CCK-named plugins/classes wrapped around the new names).

mikeryan’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record
StatusFileSize
new82.59 KB

BC layer added, draft change record written. Interdiff was a bit confused by the BC layer, but I'm assuming no one has reviewed too closely so far...

benjy’s picture

Do we need a BC layer this, Video Embed field was obviously the first contrib module using this, only last week with #2631736: Cckfield Plugins must distinguish core versions and I can't imagine many contrib modules are providing migrations from D6 but not D7 at this point. Seems like other than migrations of custom field types in custom migrations, the BC layer benefits very few people?

+++ b/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php
@@ -2,59 +2,14 @@
+class CckLink extends FieldLink {

Will this cause the processing to run twice?

mikeryan’s picture

I think at least the plugins need the BC layer - people have been implementing custom Drupal-to-Drupal migration paths and have migrations referencing those plugins, which they will have to edit if we don't have the BC layer.

Will this cause the processing to run twice?

If you're using the d6_cck_link plugin, it's implemented by the CckLink class which simply wraps the FieldLink class and runs the code in the FieldLink class.

phenaproxima’s picture

  1. +++ b/core/modules/migrate_drupal/src/Annotation/MigrateField.php
    @@ -0,0 +1,54 @@
    + * (provided by CCK in Drupal 6 and Field API in Drupal 7) to Drupal 8. They are ¶
    

    There's an extra character of whitespace at the end of this line, and the git gods will smite us if it stays.

  2. +++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php
    @@ -2,86 +2,26 @@
    +   * Apply any custom processing to the field bundle migrations.
    +   * ¶
    

    Same here (the blank line).

  3. +++ b/core/modules/migrate_drupal/tests/modules/migrate_field_plugin_manager_test/src/Plugin/migrate/field/D6FileField.php
    @@ -0,0 +1,29 @@
    +  /**
    +   * {@inheritdoc}
    +   */
    +  public function getFieldFormatterMap() {}
    

    Isn't this supposed to return an array?

  4. +++ b/core/modules/migrate_drupal/tests/modules/migrate_field_plugin_manager_test/src/Plugin/migrate/field/D6NoCoreVersionSpecified.php
    @@ -0,0 +1,25 @@
    +  /**
    +   * {@inheritdoc}
    +   */
    +  public function getFieldFormatterMap() {}
    

    Ditto here.

mikeryan’s picture

StatusFileSize
new88.39 KB

Fixed the trailing whitespace issues.

+++ b/core/modules/migrate_drupal/tests/modules/migrate_field_plugin_manager_test/src/Plugin/migrate/field/D6FileField.php
@@ -0,0 +1,29 @@
+  /**
+   * {@inheritdoc}
+   */
+  public function getFieldFormatterMap() {}

Isn't this supposed to return an array?

Perhaps - but this is not an actual change in this patch, that's just code that moved.

Had to reroll for recent changes - interdiff was unhappy because the old patch no longer applies....

mikeryan’s picture

StatusFileSize
new104.64 KB

Rerolled and empty array returns added to the tests.

Status: Needs review » Needs work

The last submitted patch, 17: consider_renaming-2683435-17.patch, failed testing.

mikeryan’s picture

Status: Needs work » Needs review

Random update test failure, retesting.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

phenaproxima’s picture

This patch is a lot less intimidating than it appears. It's just renaming things. And to that extent, it looks completely legit and incredibly thorough. Excellent work, @mikeryan!

My one question is this. If this already constitutes a BC break (and the issue is tagged as such), why are we bothering to keep the deprecated CckField cruft around? Can't we just remove it, flat-out, and break BC?

mikeryan’s picture

Issue tags: -Migrate BC break

I neglected to remove the tag when I added the BC layer.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Well, if we're going to leave the BC layer in for now, then maybe we can remove the cckfield crap in the next minor version, as suggested by @catch on IRC.

In the meantime, I dig this patch. As far as I'm concerned, RTBC.

phenaproxima’s picture

Title: Consider renaming migrates cckfield plugins » Consider renaming Migrate's cckfield plugins

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 17: consider_renaming-2683435-17.patch, failed testing.

phenaproxima’s picture

Issue tags: +Needs reroll
quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new104.79 KB

Reroll. Only one file didn't apply, core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php.

Status: Needs review » Needs work

The last submitted patch, 27: consider_renaming-2683435-27.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new106.65 KB
new1.56 KB

Missed that the D7 link migration was changed in #2674090: Unable to migrate D7 link fields. Rolled that in and it passes locally.

catch’s picture

Version: 8.3.x-dev » 8.2.x-dev

If this is no bc break, I think we should consider doing it against 8.2.x, then remove the bc in 8.3.x - that makes it more likely to happen before migrate becomes beta (after which I don't think we could remove the bc). It seems most likely people would be using these in specific migrations, which are less likely to persist beyond a minor release anyway.

quietone’s picture

Issue tags: -Needs reroll
StatusFileSize
new108.89 KB
new6.69 KB

Seems to me that the field plugin manager should be of class Drupal\migrate_drupal\Plugin\MigrateFieldPluginManager not Drupal\Component\Plugin\PluginManagerInterface. That's changed, plus some other tidy up.

And removed the reroll tag.

phenaproxima’s picture

It actually should be PluginManagerInterface, since we try to type hint to interfaces rather than actual classes. It loosens the coupling in general and makes it easier to mock test objects. Can you restore the original type hint?

quietone’s picture

StatusFileSize
new106.65 KB
new988 bytes

It also makes the IDE complain. But sure. Restored. The only change then is removing two use statements identified by the IDE as not being used. It is easier to see the wee change with interdiff against #29.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Seems completely legit.

hussainweb’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
    @@ -1,83 +1,17 @@
    -namespace Drupal\migrate_drupal\Plugin\migrate\cckfield;
    +namespace Drupal\migrate_drupal\Plugin\migrate\field;
    

    The namespace shouldn't really change here. Apart from breaking BC, it also makes this class impossible to find as the directory hasn't changed.

  2. +++ b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
    @@ -1,83 +1,17 @@
    +abstract class CckFieldPluginBase extends FieldPluginBase {
     
     }
    

    As per standards, this could all be on one line.

Another thing I realized is that since the migrations now use the newer classes, which use the newer annotations, and so on, the tests really don't check for old classes anymore. I don't really care too much about that though.

hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new2.12 KB
new89.53 KB

I fixed the points in #35 and also reduced the patch size by detecting more renames. Hopefully, that will be easier to review too.

phenaproxima’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/file/src/Plugin/migrate/process/d6/CckFile.php
    @@ -2,103 +2,12 @@
    + * @deprecated in Drupal 8.2.x and will be removed in Drupal 9.0.x. Use the
    

    This will probably be removed before D9, so let's change "in" to "before".

  2. +++ b/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php
    @@ -2,85 +2,12 @@
    + * @deprecated in Drupal 8.2.x and will be removed in Drupal 9.0.x. Use the
    

    s/in/before

  3. +++ b/core/modules/migrate_drupal/migrate_drupal.services.yml
    @@ -1,4 +1,13 @@
    +  # @deprecated in 8.2.x, to be removed in 9.0.x.
    

    s/in/before

  4. +++ b/core/modules/migrate_drupal/src/Annotation/MigrateCckField.php
    @@ -2,53 +2,16 @@
    + * @deprecated in Drupal 8.2.x, to be removed in Drupal 9.0.x. Use
    

    s/in/before

  5. +++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php
    @@ -2,86 +2,10 @@
    + * Provides an interface for all field type plugins.
      */
    -interface MigrateCckFieldInterface extends PluginInspectionInterface {
    

    This interface is missing a deprecation notice.

  6. +++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManager.php
    @@ -2,54 +2,14 @@
    + * @deprecated in Drupal 8.2.x, to be removed in Drupal 9.0.x. Use
    

    s/in/before

  7. +++ b/core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php
    @@ -0,0 +1,55 @@
    +      foreach ($migration->getPluginDefinition()['migration_tags'] as $tag) {
    +        if ($tag == 'Drupal 7') {
    +          $core = 7;
    +        }
    +      }
    

    Why not use in_array() here?

  8. +++ b/core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php
    @@ -2,122 +2,10 @@
    + * @deprecated in Drupal 8.2.x, to be removed in Drupal 9.0.x. Use
    

    s/in/before

  9. +++ b/core/modules/migrate_drupal/src/Plugin/migrate/FieldMigration.php
    @@ -0,0 +1,116 @@
    + * Migration plugin class for migrations dealing with field values.
    

    Can we change this to "field configuration and values"?

  10. +++ b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
    @@ -2,82 +2,14 @@
    +use Drupal\views\Plugin\views\field\FieldPluginBase;
    

    Whoops! This is the wrong FieldPluginBase.

  11. +++ b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
    @@ -2,82 +2,14 @@
    + * @deprecated in Drupal 8.2.x, to be removed in Drupal 9.0.x. Use
    

    s/in/before

  12. +++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
    @@ -0,0 +1,58 @@
    +    $plugin_manager = \Drupal::service('plugin.manager.migrate.field');
    

    Let's use $this->container->get() rather than \Drupal::service().

  13. +++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
    @@ -0,0 +1,58 @@
    +    $this->assertIdentical('Drupal\\file\\Plugin\\migrate\\field\\d6\\FileField', get_class($plugin_manager->createInstance('filefield', ['core' => 6])));
    

    Can we change this to assertInstanceOf() for readability?

  14. +++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
    @@ -0,0 +1,58 @@
    +    try {
    +      // If this test passes, createInstance will raise a
    +      // PluginNotFoundException and we'll never reach fail().
    +      $plugin_manager->createInstance('filefield', ['core' => 7]);
    +      $this->fail('Expected Drupal\Component\Plugin\Exception\PluginNotFoundException.');
    +    }
    +    catch (PluginNotFoundException $e) {
    +      $this->assertIdentical($e->getMessage(), "Plugin ID 'filefield' was not found.");
    +    }
    

    I'd rather this were its own test method using the @expectedException and @expectedExceptionMessage annotations.

  15. +++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
    @@ -0,0 +1,58 @@
    +    $this->assertIdentical('Drupal\\file\\Plugin\\migrate\\field\\d7\\ImageField', get_class($plugin_manager->createInstance('image', ['core' => 7])));
    +    $this->assertIdentical('Drupal\\file\\Plugin\\migrate\\field\\d7\\FileField', get_class($plugin_manager->createInstance('file', ['core' => 7])));
    +    $this->assertIdentical('Drupal\\migrate_field_plugin_manager_test\\Plugin\\migrate\\field\\D6FileField', get_class($plugin_manager->createInstance('file', ['core' => 6])));
    +
    +    $this->assertIdentical('Drupal\\text\\Plugin\\migrate\\field\\TextField', get_class($plugin_manager->createInstance('text', ['core' => 6])));
    +    $this->assertIdentical('Drupal\\text\\Plugin\\migrate\\field\\TextField', get_class($plugin_manager->createInstance('text', ['core' => 7])));
    +
    +    // Test fallback when no core version is specified.
    +    $this->assertIdentical('Drupal\\migrate_field_plugin_manager_test\\Plugin\\migrate\\field\\D6NoCoreVersionSpecified', get_class($plugin_manager->createInstance('d6_no_core_version_specified', ['core' => 6])));
    

    Let's change all of these to assertInstanceOf().

  16. +++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
    @@ -0,0 +1,58 @@
    +    try {
    +      // If this test passes, createInstance will raise a
    +      // PluginNotFoundException and we'll never reach fail().
    +      $plugin_manager->createInstance('d6_no_core_version_specified', ['core' => 7]);
    +      $this->fail('Expected Drupal\Component\Plugin\Exception\PluginNotFoundException.');
    +    }
    +    catch (PluginNotFoundException $e) {
    +      $this->assertIdentical($e->getMessage(), "Plugin ID 'd6_no_core_version_specified' was not found.");
    +    }
    

    Can this be its own method with @expectedException and @expectedExceptionMessage?

  17. +++ b/core/modules/node/src/Plugin/migrate/source/d6/Node.php
    @@ -250,6 +249,24 @@ protected function getCckData(array $field, Row $node) {
    +   * @deprecated in Drupal 8.2.x, to be removed in Drupal 9.0.x. Use
    

    s/in/before

hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new3.58 KB
new83.45 KB

@phenaproxima: Regarding most of your comments for s/in/before/: I think it is how we are interpreting those words. I see your point that it might mean that it will be present in Drupal 9.0 but it also means that it will be removed in Drupal 9.0, which means before Drupal 9.0 is released.

I checked how this is used in other parts of the core and it is mixed. Some places mention in while others use before. To me, the meaning is clear with both (because it is semver).

For point 9, I changed it to 'field config and values' as it goes beyond 80 characters.

I am fixing point 12 even though it's slightly out of scope because it is a simple change, but I think points 13-16 can be a follow-up. Actually, code in points 13 and 15 gets changed in #2787639: MigrateCckFieldPluginManager mixes up its behaviour for creating and loading definitions and then we don't need assertInstanceOf at all.

hussainweb’s picture

StatusFileSize
new5.06 KB
new89.68 KB

Based on chat in IRC with @phenaproxima, I am changing s/in/before/. I think I got them all.

Status: Needs review » Needs work

The last submitted patch, 39: consider_renaming-2683435-39.patch, failed testing.

phenaproxima’s picture

Issue tags: +Needs reroll
hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new89.41 KB

Rerolling first.

Status: Needs review » Needs work

The last submitted patch, 42: consider_renaming-2683435-42.patch, failed testing.

hussainweb’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new95.36 KB

The patch got messed up for some reason. I don't know how but I am inclined to blame OS X.

This patch should apply correctly and apart from the reroll, also changes references to MigrateCckFieldPluginManager.

Status: Needs review » Needs work

The last submitted patch, 44: consider_renaming-2683435-44.patch, failed testing.

hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new624 bytes
new95.42 KB

Kind of a stupid mistake. :/

Status: Needs review » Needs work

The last submitted patch, 46: consider_renaming-2683435-46.patch, failed testing.

hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new3.74 KB
new91.52 KB

Fixing the failure in plugin manager test.

The last submitted patch, 46: consider_renaming-2683435-46.patch, failed testing.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Looks great!

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/field/migration_templates/d6_field.yml
@@ -2,8 +2,8 @@ id: d6_field
-class: Drupal\migrate_drupal\Plugin\migrate\CckMigration
-cck_plugin_method: processField
+class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
+field_plugin_method: processField

+++ b/core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php
@@ -2,131 +2,10 @@
-          call_user_func([$this->cckPluginCache[$field_type], $this->pluginDefinition['cck_plugin_method']], $this);

I don't see how this is maintaining BC - existing migrations are going to be broken by this change - no?

phenaproxima’s picture

@alexpott, where are you seeing that? I can't locate the line in question...

benjy’s picture

The yaml changes are right at the top of the patch? The call_user_func call moved to FieldMigration which CckMigration now extends.

call_user_func([$this->fieldPluginCache[$field_type], $this->pluginDefinition['field_plugin_method']], $this);

mikeryan’s picture

StatusFileSize
new739 bytes
new1.07 KB

I see - if someone has an existing migration containing

class: Drupal\migrate_drupal\Plugin\migrate\CckMigration
cck_plugin_method: processField

CckMigration wraps FieldMigration so the right class is used, but then call_user_func() is looking for field_plugin_method and getting cck_plugin_method instead.

The attached patch will fall back to cck_plugin_method if field_plugin_method is not available.

mikeryan’s picture

StatusFileSize
new91.83 KB

Yes, git diff 8.2.x works better...

The last submitted patch, 54: consider_renaming-2683435-54.patch, failed testing.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Dublin2016

@alexpott explained his comment to me while sprinting yesterday. Nice catch.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I think the BC layer can been improved.

+++ b/core/modules/migrate_drupal/src/Plugin/migrate/FieldMigration.php
@@ -0,0 +1,140 @@
+          if (!empty($this->pluginDefinition['field_plugin_method'])) {
+            $method = $this->pluginDefinition['field_plugin_method'];
+          }
+          else {
+            // For backwards compatibility, fallback to the old
+            // cck_plugin_method.
+            $method = $this->pluginDefinition['cck_plugin_method'];
+          }

To do this I would put a const on the class.. on this class the constant would be equal to 'field_plugin_method' and on the old class that has been gutted should override this constant and set it to cck_plugin_method.

This way once we remove the old class we no longer support 'cck_plugin_method' and don't need to remember to change the new class.

hussainweb’s picture

I couldn't get to this earlier but I had a slightly different approach to solving this. Since the 'cck_plugin_method' only comes in picture when used with CckMigration, it would be better to isolate the changes there. This is what I had in mind.

class CckMigration extends FieldMigration {

  public function getProcess() {
    $this->pluginDefinition['field_plugin_method'] = $this->pluginDefinition['cck_plugin_method'];
    return parent::getProcess();
  }

}

With the above, the changes to FieldMigration in #55 can be reverted. We could probably add checks to the above but this is just to convey the idea.

The approach in #55 works too but the above code keeps the deprecated parts in the deprecated class and hence easier to remove later.

hussainweb’s picture

Ah, cross-post. The const idea by @alexpott seems like lesser work and better than what I said.

michael_wojcik’s picture

Status: Needs work » Needs review
StatusFileSize
new113.35 KB

Implemented alexpott's suggestion of adding a constant that defines which configuration option has the migration processing function.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

No interdiff because I'm getting a weird error from it ("hunk-splitting is required in this case, but is not yet implemented"). But I saw this patch before it was posted, and the changes look OK to me. RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new85.93 KB
new2.97 KB

@phenaproxima that is because the patch in #61 is not made with with

[diff]
        renames = copies

in the git config... @michael_wojcik see https://www.drupal.org/documentation/git/configure

+++ b/sites/default/default.settings.php
@@ -144,6 +144,11 @@
+ *
+ * Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in
+ * Drupal 9.0. After that, only a single prefix for all tables will be
+ * supported.
+ *

This is not part of the patch :)

Here's a new patch without that and coding standards fix. Interdiff back to #55.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Well caught, @alexpott. Thank you! Pre-emptively re-RTBC assuming Drupal CI passes.

phenaproxima’s picture

Issue tags: +blocker
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 24f816a to 8.3.x and dbf8ac6 to 8.2.x. Thanks!

Before migrate goes into beta we should get this done - there is a BC layer so existing migrations should not be affected.

  • alexpott committed 24f816a on 8.3.x
    Issue #2683435 by hussainweb, mikeryan, quietone, alexpott,...
bojanz’s picture

Committing this to 8.2.x after 8.2.1 was released is odd. As a maintainer I must either drop 8.2.1 support, or use the deprecated classes.

sam152’s picture

s/processCckFieldValues/processFieldValues is a BC break, but not sure it's worth fixing given it's such a minor change. Perhaps a mention in the CR.

I've opened #2816529: Any references to CckFieldPluginBase should now use FieldPluginBase. The tests didn't pass locally but will see what the bot says.

bojanz’s picture

Status: Fixed » Needs work

Missed that part. Time to revert this from 8.2.x then?

  • alexpott committed 4f91748 on 8.3.x
    Revert "Issue #2683435 by hussainweb, mikeryan, quietone, alexpott,...
alexpott’s picture

Ah damn the BC layer doesn't work because the old base class. Untested BC layers suck... let's fix that.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new1.25 KB
new86.43 KB

Here's the fix - I should have spotted this. And we should add a test too.

sam152’s picture

StatusFileSize
new826 bytes
new86.43 KB

Shouldn't the method name/call be the other way around?

alexpott’s picture

@Sam152 nope. We've renamed processCckFieldValues to processFieldValues so I think #73 was correct.

sam152’s picture

If you apply #73, in older plugins there is still no implementation of processFieldValues, which is what the new interface requires. #74 fixes this.

alexpott’s picture

+++ b/core/modules/node/src/Plugin/migrate/D6NodeDeriver.php
@@ -130,12 +130,12 @@ public function getDerivativeDefinitions($base_plugin_definition) {
-              $this->cckPluginCache[$field_type]
-                ->processCckFieldValues($migration, $field_name, $info);
+              $this->fieldPluginCache[$field_type]
+                ->processFieldValues($migration, $field_name, $info);

Ah I see @Sam152 is right :) nice one.

alexpott’s picture

StatusFileSize
new13.97 KB
new86.97 KB

So we can go one better and add an abstract method to keep the old interface promise alive and well.

alexpott’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

So we need to add a test module that leverages every aspect of the BC layer added here so we don't break things again.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new115.63 KB

I stared at this with a befuddled expression on my face for the better part of an hour before I figured out how to write a test for it. As far as I can tell, there's not really much to this BC layer that can be actively tested -- really, it's just the processCckFieldValues() method, and that is what I have added a test for in this patch. Everything else in the BC layer would, I'd think, reveal itself very clearly if it wasn't working -- I imagine that the Migrate tests would be blowing up left and right with complaints about non-existent classes and interfaces, or calls to non-existent methods. If there are other aspects of the BC layer that need explicit tests, I'm all ears.

Apologies that there is no interdiff -- for some reason, despite my best efforts, the patch is always an extra 30 KB when I roll it, so interdiff gives me flak about "hunk-splitting", whatever that means, and refuses to generate an interdiff.

alexpott’s picture

StatusFileSize
new88.75 KB
new2.5 KB

Here's a proper patch which looks the right size and an interdiff to #78.

alexpott’s picture

Status: Needs review » Needs work
+++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
@@ -56,4 +57,22 @@ public function testPluginSelection() {
+    // Ensure that the processCckFieldValues() method exists and is callable
+    // (i.e., public).
+    $callable = [$plugin, 'processCckFieldValues'];
+    $this->assertInternalType('callable', $callable, 'processCckFieldValues method is callable');

We need to call process on it and ensure that processCckFieldValues() is called. Atm this is not really testing the BC layer.

phenaproxima’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new89.92 KB

Okay. After getting clarification from @alexpott in IRC, here is a better test that actually verifies the BC layer for processCckFieldValues(). Sorry about the continued lack of an interdiff; my git is still misbehaving for whatever reason.

Status: Needs review » Needs work

The last submitted patch, 83: 2683435-83.patch, failed testing.

heddn’s picture

Issue tags: +Migrate BC break

The last submitted patch, 83: 2683435-83.patch, failed testing.

heddn’s picture

Issue tags: -Migrate BC break

Actually, there isn't a BC break here. What was I thinking? However, it is blocking #2631698: Fix sub-optimal DX in MigrateFieldInterface, which is a BC break.

prashant.c’s picture

Status: Needs work » Needs review
StatusFileSize
new20.16 KB

Status: Needs review » Needs work

The last submitted patch, 88: 2683435-88.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new96.75 KB

Rerolled and fixed the broken test. No interdiff because reroll.

neclimdul’s picture

This is almost certainly an API Break. If nothing else there is the new/changed abstract method in CckFieldPluginBase so custom cck migrations would have to change. Whether that's ok is a different discussion.

+++ b/sites/default/default.settings.php
@@ -144,6 +144,11 @@
+ *
+ * Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in
+ * Drupal 9.0. After that, only a single prefix for all tables will be
+ * supported.
+ *

This doesn't look right and wouldn't apply locally.

mikeryan’s picture

Status: Needs review » Needs work

This is almost certainly an API Break. If nothing else there is the new/changed abstract method in CckFieldPluginBase so custom cck migrations would have to change. Whether that's ok is a different discussion.

Could you elaborate on this? What I see in the current patch is that processCckFieldValues() got moved from the interface into an abstract function on CckFieldPluginBase - the signature is the same, and custom plugins derived from CckFieldPluginBase will need to define it either way, so I don't see how they would break.

This doesn't look right and wouldn't apply locally.

Looks like someone missed a rebase? Setting "needs work" to fix this...

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new91.64 KB

Reroll of the latest patch. Something changed in file/src/Plugin/migrate//process/d6/CckFile.php.

mikeryan’s picture

Assigned: Unassigned » heddn

@heddn, can you review and possibly RTBC?

Thanks.

heddn’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/field/src/Plugin/migrate/process/FieldType.php
    @@ -41,14 +41,14 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface {
    +  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrateFieldPluginManagerInterface $field_plugin_manager, MigrationInterface $migration = NULL) {
    

    Does this break BC?

  2. +++ b/core/modules/file/src/Plugin/migrate/process/d6/CckFile.php
    @@ -2,91 +2,9 @@
    \ No newline at end of file
    

    Nit.

  3. +++ b/core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php
    @@ -75,7 +76,18 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
    +    // throw a MigrateSkipRowException. It shouldn't, but that is being dealt
    +    // with at https://www.drupal.org/node/2487568. Until that lands, return
    +    // an empty item.
    +    catch (MigrateSkipRowException $e) {
    +      return [];
    +    }
    

    Issue 2487568 is closed won't fix. Why is this comment in here? I think this came from a re-roll. This entire try/catch was recently removed from the codebase in another commit.

  4. +++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php
    @@ -2,86 +2,11 @@
    + * Provides an interface for all field type plugins.
    

    This is still for cck field types, so no need to change the wording here.

  5. +++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManager.php
    @@ -2,54 +2,12 @@
    + * Deprecated: Plugin manager for migrate field plugins.
    

    Same here. In the BC layer, this is still for cckfields.

  6. +++ b/core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php
    @@ -2,131 +2,17 @@
    + * Migration plugin class for migrations dealing with field values.
    

    BC layer should still call this CCK field values, no?

  7. +++ b/sites/default/default.settings.php
    @@ -144,6 +144,11 @@
    + * Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in
    + * Drupal 9.0. After that, only a single prefix for all tables will be
    + * supported.
    

    This is a stray insertion.

heddn’s picture

We are fairly close to committing this, but to make it easier for reviews, I've opened #2833206: Convert Migrate's cckfield plugins to use the new field plugins to handle the actual conversion work. Let's slim this back to a single conversion and testing the BC layer. Then punt the rest into the follow-up. With the lack of interdiffs and the re-roll issues we've been facing, I think splitting is going to make things a lot easier.

heddn’s picture

Assigned: heddn » quietone

Discussed in the weekly migrate meeting and decided that splitting this into two issues has decent rational. Assigning to quiteone for additional follow-up.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new89.79 KB
new15.45 KB

First, fixes for 2-7 in #95.

quietone’s picture

StatusFileSize
new84.45 KB
new16.28 KB

Remove the migration ymls.

slim this back to a single conversion

Tried to do this but then MigrateNodeTest fails.

quietone’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll, +Novice

Needs a reroll after #2673960: Unable to migrate D7 User cck fields. Tagging as novice for the reroll.

quietone’s picture

Assigned: quietone » Unassigned
steven jones’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll, -Novice
StatusFileSize
new89.89 KB

I've re-rolled the patch. There was the expected conflict of the User migrate plugin, whose base class needed to change.

I couldn't seem to get a sensible interdiff, sorry!

Status: Needs review » Needs work

The last submitted patch, 102: 2683435-102.patch, failed testing.

heddn’s picture

Issue tags: +Needs reroll, +Novice

re #102 a interdiff isn't necessary for a re-roll. However, it looks like there might be some imports that didn't get fixed-up. Go ahead and give it another try today. It's close.

steven jones’s picture

Status: Needs work » Needs review
StatusFileSize
new90.1 KB

Ah yeah, sorry, this fixes the obvious issue with the patch in #102.

Status: Needs review » Needs work

The last submitted patch, 105: 2683435-105.patch, failed testing.

steven jones’s picture

Status: Needs work » Needs review
StatusFileSize
new91.08 KB

Apologies for the noise. PHPStorm was even warning me about those.

Status: Needs review » Needs work

The last submitted patch, 107: 2683435-107.patch, failed testing.

steven jones’s picture

I came for a simple-ish re-roll and mistakes aside, I think there's a non-trivial issue remaining now.

Trying to make sense of this patch etc, it looks like maybe the term reference field isn't being migrated properly.

This possibly makes sense, because the D7TaxonomyTermDeriver class is using the cckfield BC layer, and calling processCckFieldValues still I can't see how that makes it back to call processFieldValues, but I'm not really sure, sorry!

  • alexpott committed 24f816a on 8.4.x
    Issue #2683435 by hussainweb, mikeryan, quietone, alexpott,...
  • alexpott committed 4f91748 on 8.4.x
    Revert "Issue #2683435 by hussainweb, mikeryan, quietone, alexpott,...

  • alexpott committed 24f816a on 8.4.x
    Issue #2683435 by hussainweb, mikeryan, quietone, alexpott,...
  • alexpott committed 4f91748 on 8.4.x
    Revert "Issue #2683435 by hussainweb, mikeryan, quietone, alexpott,...
quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new95.14 KB
new3.91 KB

I think D7TaxonomyTermDeriver made it in after this patch in #99. So, update that file to use the field plugins and not cck plugins.

quietone’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll, -Novice

Right, tests pass now. Still to do is

slim this back to a single conversion

. Anyone up for working on that?

Removing novice and needs reroll tags and setting to NW.

phenaproxima’s picture

Issue tags: +Migrate critical

This is critical because it's blocking a critical: #2447727: Add base class for migrating reference fields

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

steven jones’s picture

slim this back to a single conversion

Any chance you could outline what this involves? From my limited understanding of this issue on of these conversions was performed between the patches in #107 and #112? So we'd be rolling that back? But we already know that won't work. So is it that or is it something else?

heddn’s picture

@Steven Jones, my comment there is to put in the new plumbing and do only a single conversion. Then punt all the rest to a follow-up. At nearly 100K, this get very complicated to do a valid review. The plumbing by itself is fairly large. So, let's commit it, prove it works by doing a single conversion and do the rest later.

steven jones’s picture

@heddn Okay, so what I'm getting at it is what is a 'single conversion'?

Would an example from the patch in #112 be the conversion of core/modules/file/src/Plugin/migrate/cckfield/d7/ImageField.php to core/modules/file/src/Plugin/migrate/field/d7/ImageField.php ?

So we undo all but one of those conversions and if the patch still passes then we should be good to go, and we pop those individual conversions back in other patches.

Or

Is it that the changes to D7TaxonomyTermDeriver need to be rolled back to get this in?

It seems like we have a BC layer for the field plugins, but not for the migrations themselves, is that understanding correct?
I.e. people will need to upgrade their migrations that are using cckfield plugins, but people implementing cckfield plugins will get the BC layer.

heddn’s picture

re #118: the first option. Patch in #112 and a single conversion; the example of ImageField is fine. The rest in a follow-up.

steven jones’s picture

Assigned: Unassigned » steven jones
StatusFileSize
new66.8 KB
new68.13 KB

I applied the patch in #112 and then went through and un-did what I think were all the changes for the 'conversions' leaving the plumbing and hopefully valid tests in place. This is the -no-conversions patch.

I then re-added the changes for the Imagefield, i.e. the single conversion discussed in #118 and #119. This is the -imagefield-conversion.patch

I don't have a local testing environment set up at the moment, so these patches may fail I suppose. If they do I'll get an environment set up and work on them until they don't.

steven jones’s picture

Issue summary: View changes
Status: Needs work » Needs review

The last submitted patch, 120: drupal-2683435-120-no-conversions.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 120: drupal-2683435-120-imagefield-conversion.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new43.21 KB

I've had a go at re-writing the no-conversions patch and will take on the imagefield conversion patch next.

jofitz’s picture

StatusFileSize
new27.08 KB

...and here's an interdiff.

Status: Needs review » Needs work

The last submitted patch, 124: drupal-2683435-124-no-conversions.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new42.73 KB
new5.98 KB

Here's another attempt at the no-conversions patch from which to base the (single) imagefield conversion patch.

jofitz’s picture

Assigned: steven jones » Unassigned
StatusFileSize
new61.67 KB
new18.94 KB

Yet another improved version of the no-conversions patch.

The single conversion patch will be based from (the final version of) this - with the filefield updated (rather than imagefield which only has a D7 version).

Please shout if you think this patch is taking things in the wrong direction - I don't want to be wasting my time!

Status: Needs review » Needs work

The last submitted patch, 128: drupal-2683435-128-no-conversions.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new61.86 KB

Rerolled the patch.

quietone’s picture

StatusFileSize
new70.21 KB
new7.78 KB

I understand the intention was to include filefield but I has some errors and thought I would try with the link field. That seems to work, so lets see what testbot finds.

quietone’s picture

Status: Needs review » Needs work

No, that is wrong. I left in core/modules/link/src/Plugin/migrate/cckfield and didn't update the associated CckLinkTest.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new71.85 KB
new8.59 KB

Ignore patch in #131.

Another attempt at add just the link migration.

After too much blank staring at field types, field formatters and field widgets and caffeine I finally spotted something worth changing. It is easy to see by comparing d6_field_instance_widget_settings.yml and d7_field_instance_widget_settings.yml. The d7 version converts 'link_field' to 'link_default' but the d6 version has no similar conversion for 'link'. Simply adding 'link: link_default' in the d6 migration template is an improvement, d6/MigrateNodeTest fails without that change. Although MigrateUpgrade6Test fails on the link migration.

But I've yet to explain why in the full cck environment this works without that change. What am I missing?

Let's see what else the testbot finds.

Status: Needs review » Needs work

The last submitted patch, 133: drupal-2683435-133-with-link.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new72.45 KB
new449 bytes

The map table error was "Failed to lookup field type array ( 0 => 'link',...". Sorry about the abbreviated error, I didn't save it. In response to that,, this patch adds link to the static map looking in d6_field_formatter_settings.

Status: Needs review » Needs work

The last submitted patch, 135: drupal-2683435-135-with-link.patch, failed testing.

quietone’s picture

No, that is wrong too. Rubber duck (actually, mine is a gnu soft toy) programming isn't working for me on this.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new62.69 KB
new8.09 KB

Big thank you to joelpittet for his assistance via a hangout. Full credit to him for finding the problem (and showing me another way to think about the problem), I just made the patch.

There are 7 files that use the new MigrateFieldPluginManager. Six of those try to get the plugin from the MigrateCckFieldPluginManager first and if that fails it then uses the Migrate FieldPluginManager. Just needed to make the 7th file, FieldMigration, do that and things are much better.

This is working locally with the link conversion. But before testing that, let's make sure all the tests pass with these changes to the no-conversions patch.

Status: Needs review » Needs work

The last submitted patch, 138: drupal-2683435-138-no-conversions.patch, failed testing.

quietone’s picture

OK more errors. I'm not sure the 'proper' way to fix FieldMigration and CckMigration. Can someone provide some guidance on that?

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new62.7 KB
new1.24 KB

I think all that was missing was a little tweak to Drupal\user\Plugin\migrate\User (which extends FieldMigration which was edited in #138) - locally it now passes the tests that failed on #138, let's see what the testbot has to say...

jofitz’s picture

StatusFileSize
new72.21 KB
new8.28 KB

Now that we (hopefully) have a stable "no conversions" version, here is a version with a single conversion: linkfield.

(Assuming the testbot passes this patch) we now meet @heddn's requirements from way back in #96. RTBC perhaps?

quietone’s picture

@Jo Fitzgerald, thanks for looking at this again. I noticed that since User.php extends from FieldMigration it doesn't need it own constructor, so I removed all that. And I moved the cckPluginCache property into FieldMigration.

Status: Needs review » Needs work

The last submitted patch, 143: interdiff-141-143.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new69.3 KB
new8.28 KB

Sorry, rename the previous interdiff wrong.

Now apply the changes for the link conversion.

quietone’s picture

With that small change we are ready for review.

From #96

Discussed in the weekly migrate meeting and decided that splitting this into two issues has decent rational. Assigning to quiteone for additional follow-up.

After that the goal was to make two patches, one with just the renaming and another with one conversion added. That has now been achieved.

The patch in #143 does the renaming only. The patch in #145 does the renaming plus one conversion. That will prove it works with both cck plugins and field plugins in play and it makes the patch smaller and easier to review. The conversion done is to rename the d6 and d7 link plugins from @MigrateCckField to @MigrateField.

heddn’s picture

Assigned: Unassigned » heddn

Assigning to myself to review.

Status: Needs review » Needs work

The last submitted patch, 145: drupal-2683435-145-with-link.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new68.79 KB

Re-rolled.

Let's get this one moving again and push it over the line.

Status: Needs review » Needs work

The last submitted patch, 149: drupal-2683435-149-with-link.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new69.3 KB
new1.12 KB

The field plugin, LinkField.php, was in the directory cckfield instead of field.

dbjpanda’s picture

Status: Needs review » Reviewed & tested by the community

Patch cleanly applied.

quietone’s picture

Status: Reviewed & tested by the community » Needs review

@dbjpanda, thank you for your review. You say that patch applied, but what other tests or review did you do? What comes to mind is checking that it meets the coding standards, running the relevant tests locally or even running a real migration using this patch. There is more information about Reviewing Patches in the handbook.

For now, setting back to NR.

heddn’s picture

Assigned: heddn » Unassigned
Status: Needs review » Needs work
+++ b/core/modules/field/src/Plugin/migrate/process/FieldType.php
@@ -76,7 +88,13 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
+      try {
+        $plugin_id = $this->fieldPluginManager->getPluginIdFromFieldType($field_type, [], $this->migration);
+        return $this->fieldPluginManager->createInstance($plugin_id, [], $this->migration)->getFieldType($row);
+      }
+      catch (PluginNotFoundException $e) {
+        return parent::transform($value, $migrate_executable, $row, $destination_property);
+      }
     }

I think it would make more sense to flip this logic and do try first on the new fieldManager, followed by cck.

And we should re-roll things for #2575081: [policy, no patch] Use E_USER_DEPRECATED in Drupal 8 minor releases and https://www.drupal.org/node/2575081. Almost there.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new74.51 KB
new15.94 KB

Flipped the logic on all the occurrances of getting a cck or field plugin so the field plugin is done first. Added the new deprecations and changed the notice to use 8.3.x instead of 8.2.x. Note that there isn't an example for classes, https://www.drupal.org/node/2856615#how-class, so this could be very wrong.

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Not sure about the standards either. But let's see what a committer things. And... drumroll....
This is ready for RTBC again.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 155: drupal-2683435-154-with-link.patch, failed testing.

quietone’s picture

Back to the drawing board?

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new74.5 KB
new1.18 KB

I didn't check every error most there are a significant number of yaml parse errors. I had followed,https://www.drupal.org/node/2856615#how-service, as is but the deprecated can't span lines. So fixed that.
And there was a trailing whitespace error.

Pavan B S’s picture

StatusFileSize
new81.25 KB
new10.71 KB
+++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
@@ -0,0 +1,52 @@
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = array('system', 'user', 'field', 'migrate_drupal', 'options', 'file', 'text', 'migrate_field_plugin_manager_test');

@inheritoc should be near to the method testPluginSelection() and use short array syntax.

Applying the patch , suggest me comments please,if i am wrong .

Status: Needs review » Needs work

The last submitted patch, 160: drupal-2683435-160-with-link.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new74.49 KB
new2.61 KB

Let's sort out those pesky coding standards.

jofitz’s picture

OK @heddn, bring on the RTBC! :)

heddn’s picture

Status: Needs review » Reviewed & tested by the community

And back to rtbc

heddn’s picture

Issue summary: View changes

Attempt to update IS with outstanding tasks.

catch’s picture

Issue summary: View changes
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/migrate_drupal/src/Annotation/MigrateCckField.php
    @@ -2,53 +2,20 @@
    +removed before Drupal 9.0.x. Use  \Drupal\migrate_drupal\Annotation\MigrateField
    

    two spaces in front of \Drupal - this could have been fixed on commit but there are a couple of other things...

  2. +++ b/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php
    @@ -2,85 +2,9 @@
    +class CckLink extends FieldLink { }
    

    Is this not deprecated too?

  3. +++ b/core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php
    @@ -2,131 +2,17 @@
    + * @deprecated in Drupal 8.2.x, to be removed before Drupal 9.0.x. Use
    

    These need to be updated to 8.3.x

jofitz’s picture

Assigned: Unassigned » jofitz

On it...

jofitz’s picture

Assigned: jofitz » Unassigned
Status: Needs work » Needs review
StatusFileSize
new74.63 KB
new1.82 KB

Made all the changes from #167.

heddn’s picture

Status: Needs review » Needs work

I think we want to use trigger_error(), no? See #154 & https://www.drupal.org/node/2575081

jofitz’s picture

I assume you are referring to \Drupal\link\Plugin\migrate\process\d6\CckLink. Should the same apply to \Drupal\migrate_drupal\Plugin\migrate\CckMigration too?

jofitz’s picture

Status: Needs work » Needs review
StatusFileSize
new74.99 KB
new5.15 KB
  • Added trigger_error() to the two deprecated files that were missing it.
  • Corrected a reference to 8.2.x that should be 8.3.x.
  • Removed a few redundant spaces.
heddn’s picture

Status: Needs review » Reviewed & tested by the community

And back to RTBC.

heddn’s picture

Queuing up tests, just to be extra careful. I don't want to see this get reverted.

alexpott’s picture

Title: Consider renaming Migrate's cckfield plugins » CCK does not exist in Drupal 7, rename Migrate's cckfield plugins to field plugins

Renamed to make it less of a consideration.

heddn’s picture

Random failure due to #2860663: UserTimeZoneTest fails on PHP 7.0.x-dev and 7.1.x-dev. But otherwise, tests came back green.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 172: 2683435-172-with-link.patch, failed testing.

jofitz’s picture

Status: Needs work » Reviewed & tested by the community

Retests passed, back to RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 172: 2683435-172-with-link.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Reviewed & tested by the community

This appears to have been set back to NW for no reason whatsoever. I blame Drupal CI.

phenaproxima’s picture

Briefly discussed with @webchick and she thinks this probably needs framework manager review.

catch’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
Issue tags: -Needs framework manager review

Both I and Alex Pott have reviewed this a fair bit (and Alex wrote some of the bc layer), it just kept falling through the gaps of the RTBC queue for me.

Committed/pushed to 8.4.x, thanks! Moving to 'to be ported' for after the 8.3.x code freeze.

  • catch committed 8f146a6 on 8.4.x
    Issue #2683435 by quietone, Jo Fitzgerald, hussainweb, mikeryan, Steven...
quietone’s picture

mikeryan’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
jofitz’s picture

  • Gábor Hojtsy committed a0a5880 on 8.3.x authored by catch
    Issue #2683435 by quietone, Jo Fitzgerald, hussainweb, mikeryan, Steven...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Baltimore2017

Thanks all! Merged this in as per our discussion in person yesterday. Let's unblock everything else :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

heddn’s picture

Issue tags: +8.4.0 release notes

Tagging for mention in 8.4.0 release notes. This is all related to the same change record: https://www.drupal.org/node/2751897

xjm’s picture

Issue tags: -8.4.0 release notes

Since this has a BC layer, follows our deprecation policies, and has a good change record, I don't think it needs a release notes mention on its own. It seems like it was a soft blocker for a number of other critical issues that are mentioned on their own already. :)

Thanks everyone!