Paragraph Migrations broken by archived flag

Created on 9 March 2022, almost 3 years ago
Updated 26 January 2024, 11 months ago

Problem/Motivation

When migrating paragraphs using generated configuration from drush migrate-upgrade --configure-only, I ran into an issue where a paragraph type was not migrating, stating that a dependency was not met.

[error] Migration upgrade_d7_paragraphs_revisions_block_reference did not meet the requirements. Missing migrations upgrade_d7_paragraphs_navigation_card_item. requirements: upgrade_d7_paragraphs_navigation_card_item.

The issue was that that dependency was met, the upgrade_d7_paragraphs_navigation_card_item migration had run successfully.
I saw that there were 4 paragraphs in the source db marked as archived. These were rows that were being unprocessed and hence the subsequent migration was seeing this migration as incomplete.

When doing debug on Drupal\migrate\Plugin\Migration I could see that in allRowsProcessed() it was returning false as the count of processed rows was lower.
Since it seems that archived is being ignored in source not in process it is not counting those rows.

Tried adding a skip on value in process but at that point the row was already being ignored.
Tried disabling the cache.backend.null setting on the cache as stated in https://www.drupal.org/project/drupal/issues/2878858 🐛 Migration did not meet the requirements when using cache.backend.null Closed: outdated
This is similar to https://www.drupal.org/project/drupal/issues/2797505 🐛 Migrations fail due to missing dependency when dependency has skipped rows by the source plugin Needs review but in this case the row count mismatch is not due to duplicates or errors but due to the code skipping archived paragraph items.

My quick fix in this case was to delete those rows from the DB as I knew they were not needed.

Steps to reproduce

Create a paragraph type and create content
Mark some paragraphs as archived in the db
Create migrations and have at least one migration require the paragraph migration.
Run migrations

Proposed resolution

Mark the row as ignored on archived, but process it.

Remaining tasks

Code change / config

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom ChrisDarke London

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024