Problem/Motivation

EntityRevision:getIds() returns only ['revision_id'] and I think it should return ['id', 'revision_id'] so we can track both ids.

Currently Im migration an entity with ERR fields appling patch in #2809793: EntityReference migrate destination which creates a migration destination that extends from EntityRevision.

Thanks.

Proposed resolution

As stated in #5 only the vid is stored for revision migrations, if that were to change then it will break migrations of revisions from D6/D7. In the same comment heddn suggests that the langcode should be added to EntityRevision.php. This was added in #2921661: Add support to migrate multilingual revisions.

Remaining tasks

Close as wont fix?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ruloweb created an issue. See original summary.

ruloweb’s picture

heddn’s picture

Issue tags: -migrate
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php
@@ -72,6 +72,8 @@ protected function save(ContentEntityInterface $entity, array $old_destination_i
+    $ids = parent::getIds();

I think core revision support here intentionally intends to only track revisions, not a composite of revision and entity id. However, while reviewing this, I did note that we are not supporting revisions that are multi-lingual. Is that an issue that should be addressed?

We don't cover multi-lingual, because we aren't calling parent (rightfully so). But we do probably want to track the langcode on revisions, if the revision is multi-lingual. I've addressed that in #2809793-12: EntityReference migrate destination, but ideally CEB would have the multi-lingual code broken out into a protected function so I can just call it from ERR, rather than copy/pasting it.

ruloweb’s picture

and what is the idea behind this? if ERR calls parent:Ids() it wont be neccesary to solve id and language on each class that extends EntityRevision, as you did on #2809793-12: EntityReference migrate destination

heddn’s picture

revisions in D8 don't store a composite. Only the vid. This destination plugin was built for migrating in those values into core. If it returns a composite, it will break migrations of revisions from D6/D7. However, revisions do support mult-lingual. So we should suck in that data (me thinks).

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.

heddn’s picture

Issue tags: +Needs reroll

Patch doesn't apply.

heddn’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.88 KB

The old patch wasn't what we wanted so I didn't bother re-rolling it.

mikeryan’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests
mikeryan’s picture

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

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

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

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

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

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

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

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs tests, -Needs issue summary update

On reviewing this it looks like it is a won't fix based on the comments in #5

Changing to NR to allow for replies.

heddn’s picture

This needs an IS update at the very least. We might need to track the langcode for revisions. Which is my last point in #5. Of course, that has BC implications.

quietone’s picture

Assigned: Unassigned » quietone

Since I'm doing a lot of multilingual.....

quietone’s picture

The proposed resolution points out that the langcode was added in #2921661: Add support to migrate multilingual revisions.

EntityRevision::getIds()

    if ($this->isTranslationDestination()) {
      $langcode_key = $this->getKey('langcode');
      if (!$langcode_key) {
        throw new MigrateException(sprintf('The "%s" entity type does not support translations.', $this->storage->getEntityTypeId()));
      }
      $ids[$langcode_key] = $this->getDefinitionFromEntity($langcode_key);
heddn’s picture

Status: Needs review » Closed (won't fix)

Sounds good.

quietone’s picture

Assigned: quietone » Unassigned