Problem/Motivation
#2911244: Field collections deriver and base migration made migrating Paragraphs from Drupal 7 to Drupal 9 much simpler. (Although per #3178043-4: Experience report: migrating D7 field collections to D8 paragraphs — we should also land #3145755: Orphaned (nested) paragraphs entities after migration & (invalid) stub paragraph entity leftovers so we can start labeling it "mostly easy" — it still is pretty hard.)
On January 11, #2565931-112: Handle long comment bundle names was committed to 9.1.x
and 9.2.x
. Ever since then, the already-failing Paragraphs tests on Drupal 9.2 started failing much more severely:
The root cause: #2565931: Handle long comment bundle names modifies core/modules/field/migrations/d7_field_instance.yml
's process
pipeline for 'bundle'
and #2911244: Field collections deriver and base migration introduced the Paragraphs module modifying that very same process pipeline in the migration definition, in \Drupal\paragraphs\MigrationPluginsAlterer::paragraphsMigrationBundleAdjust()
, which does:
public function paragraphsMigrationBundleAdjust(array &$migration) {
if (!self::paragraphsMigrationPrepareProcess($migration['process'], 'bundle_mapped')) {
return;
}
$bundle_process = &$migration['process']['bundle_mapped'];
$bundle_process[] = [
'plugin' => 'paragraphs_process_on_value',
'source_value' => 'entity_type',
'expected_value' => 'field_collection_item',
'process' => [
'plugin' => 'substr',
'start' => FieldCollection::FIELD_COLLECTION_PREFIX_LENGTH,
],
];
}
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#6 | 3203739-6.patch | 1.09 KB | huzooka |
#3 | 3203739-3.patch | 1 KB | Wim Leers |
#2 | 3203739-2.patch | 1 KB | Wim Leers |
Screenshot 2021-03-15 at 20.18.24.png | 491.56 KB | Wim Leers |
Comments
Comment #2
Wim LeersComment #3
Wim Leers#2 is relative to #3145755: Orphaned (nested) paragraphs entities after migration & (invalid) stub paragraph entity leftovers, that's why it doesn't apply cleanly.
Rerolled #2 to apply independently …
Comment #4
Wim Leers#3 still has 4 test failures on 9.1 and 9.2, but they're the ones from before #2565931: Handle long comment bundle names.
So, being bold and self-RTBC'ing 🤓
Comment #5
rozh CreditAttribution: rozh commented+1 for RTBC. Patch #3 works for me. Drupal 9.1.5, migration executed with Drush.
Comment #6
huzookaRerolled patch relative to #3145755: Orphaned (nested) paragraphs entities after migration & (invalid) stub paragraph entity leftovers (replaces #2).
Comment #7
davedg629 CreditAttribution: davedg629 commentedPatch #3 won't apply for me (D9.1.8 & Paragraphs 8.x-1.12). Am I doing something wrong or is that by design due to the tests that are still failing? Sorry, I'm a n00b.
Comment #8
huzookaMaybe it's because https://www.drupal.org/project/paragraphs/issues/2911244 isn't released yet?
Comment #9
davedg629 CreditAttribution: davedg629 commentedOk, but it looks like others were able to apply the patch and I'd like to know how they did that.
Do I first need to apply the patch from this issue? #3145755: Derive Field Collection and Paragraph entity migrations based on their parent entity type ID (and parent entity bundle)
Edit: Was able to get this patch applied by applying the above mentioned patch first.
My issue is with also trying to apply the patch from this issue: https://www.drupal.org/project/paragraphs/issues/2977853. Looks like further work needs to be done on that patch like was done on #3145755: Derive Field Collection and Paragraph entity migrations based on their parent entity type ID (and parent entity bundle) to make it compatible with the patch in this issue.
Comment #10
MariaIoann CreditAttribution: MariaIoann commentedPatch #3 worked for me with Drupal Core 9.1.9 and Paragraphs 8.1.x-dev and w/o any other Paragraphs patch applied.
The following snippet is produced for a field_foo paragraph field, with migrate-upgrade after applying the patch:
Comment #11
huzooka#3226658: Guarantee the uniqueness of the migrated paragraph types fixes this issue as well (and a bit more as well).
Comment #12
BerdirSlightly confusing but I think #3 is the patch to commit, did that.