Problem/Motivation
In #2687849: Add back rollbacks on migrate_drupal_ui the following error occurred during the rollback.
1) Drupal\Tests\migrate_drupal_ui\Functional\d6\Rollback6Test::testMigrateUpgradeExecute
Exception: Error: Call to a member function getConfigDependencyName() on null
Drupal\migrate\Plugin\migrate\destination\EntityConfigBase->rollback()() (Line: 279)
This is likely a dependency problem. In that issue the fix there was to ensure the config entity exists before attempting to delete it. This issue is to figure out the dependency problem.
For Drupal6, the problem appears when trying to rollback d6_profile_field_option_translation.
See 2687849-#151
Steps to reproduce
If not committed, apply the latest patch from #2687849: Add back rollbacks on migrate_drupal_ui and then remove the following lines from core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php, Then run Upgrade6Test or Upgrade7Test.
+ // Ensure the entity exists before attempting to delete.
+ if (!is_null($this->storage->load($entity_id))) {
Proposed resolution
Change the dependency in d6_profile_field_option_translation.yml from user_profile_field to user_profile_field_instance.
Add language to all the d6 user profile translation migrations
Fix an error d6_user_profile_field_instance_translation.yml
Remaining tasks
patch
review
commit
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#10 | 3191782-10.patch | 4.73 KB | Wim Leers |
#10 | interdiff.txt | 1.04 KB | Wim Leers |
#7 | 3191782-7.patch | 5.66 KB | quietone |
#7 | interdiff-5-7.txt | 1.73 KB | quietone |
#5 | 3191782-5.patch | 4.84 KB | quietone |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commentedDuring rollback via the UI user_profile_field_instance was executed before d6_profile_field_option_translation. And that rollback, user_profile_field_instance, deletes the fields used by d6_profile_field_option_translation. The fix is to simply change the dependency on user_profile_field_instance to user_profile_field_instance instead of user_profile_field.
Since dependencies are being changed here, I think that language should be added to the dependencies. And also, fix a mistake in d6_user_profile_field_instance_translation where user_profile_field and user_profile_field_instance are listed in the dependencies. Only user_profile_field_instance needs to be there because it is dependent on user_profile_field.
Comment #3
quietone CreditAttribution: quietone as a volunteer commentedComment #5
quietone CreditAttribution: quietone as a volunteer commentedI forgot to update the Migration tests. The fail patch above is still valid, the failing test is the new test, d6/MigrateUserProfileTranslationRollbackTest.php which passes in the patch in #2.
Comment #7
quietone CreditAttribution: quietone as a volunteer commentedOh bother, I changed the wrong test.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedComment #9
mohit_aghera CreditAttribution: mohit_aghera at QED42 commented1. Issue summary and problem statement are clear.
2. I tried to reproduce the issue from Steps to reproduce section and I was able to reproduce on local.
3. Patch is straightforward and seems to fix the issue.
Comment #10
Wim LeersThis is out of scope here.
It's a copy/paste from #3197324-3: Exception trace cannot be serialized because of closure.
Rather than marking
, keeping the current status and just fixing it 😊Comment #11
quietone CreditAttribution: quietone as a volunteer commented@Wim Leers, thank you. That it correct, that should be removed.
Comment #14
catchRestoring status after HEAD was broken.
Comment #15
larowlanComment #17
larowlanCommitted a5103bb and pushed to 9.3.x. Thanks!
Backported to 9.2.x as there is little risk of disruption here, other than the test we're just changing some migration dependencies.