Problem/Motivation
Currently when you try to login after a full migration there is a fatal error on the user edit page. Specifically:
Notice: Undefined index: third_party_settings in Drupal\Core\Field\WidgetPluginManager->createInstance() (line 130 of core/lib/Drupal/Core/Field/WidgetPluginManager.php).
Recoverable fatal error: Argument 5 passed to Drupal\Core\Field\WidgetBase::__construct() must be of the type array, null given, called in core/lib/Drupal/Core/Field/WidgetPluginManager.php on line 130 and defined in Drupal\Core\Field\WidgetBase->__construct() (line 55 of core/lib/Drupal/Core/Field/WidgetBase.php
Proposed resolution
I tried adding this to the d6_user_profile_entity_form_display migration as you would expect but it just wouldn't stick. I also tried adding tests for third_party_settings but that wouldn't fail within the test runner. Patch attached just ensures it's set in the destination which did in the end fix the problem but might not be the right approach.
Remaining tasks
User interface changes
API changes
Comments
Comment #1
chx commentedComment #2
benjy commentedIt would be great if someone else could also test this, I could not get this to work by simply putting third_party_settings in the profile fields entity form display migration.
Maybe it's better in the destination anyway since without it, you get a fatal error when viewing the entity edit screen.
Comment #4
ultimikeBenjy,
I couldn't reproduce the fatal error (without the patch). Here's what I did:
Did I miss something?
-mike
Comment #5
benjy commented@ultimike, hmm that's interesting. I've attached my manifest and the database i used if you want to have a test with that. Maybe the error is specific to certain field types on the user. I did keep seeing boolean_checkbox, maybe try adding that field your current setup as well?
Comment #6
ultimikeBenjy,
Just adding a D6 profile checkbox field to my local D6 test site doesn't cause the D8 user edit page to WSOD.
I then tried it with your D6 DB and my go-to full migration .yml file - still, no WSOD.
Finally, I tried it with your D6 DB and your manifest.yml, and couldn't get the migration to complete. I enabled the book module, but the migration still failed. I've attached my output.
-mike
Comment #7
benjy commentedThe last fatal you got is fixed by #2394567: File field need associated metadata during cck_field migration
The other errors are, link module not enabled, missing files and a known error (without an issue) for the bundle promote setting migration.
I'll have another go at debugging this next week.
Comment #8
benjy commentedOK, the attached patch also fixes the issue by changing the migrations. Seems like it could be good in the destination since it might be easy for custom migrations to slip up.
Hopefully have a test coming soon.
Comment #9
benjy commentedOK, tracked this down to the user picture and upload fields. Fail patch attached + tests and fix.
Comment #12
benjy commentedThat seems like a random fail UserAdminTest?
I've added the fix for d6_user_profile_entity_form_display as well.
Comment #13
gábor hojtsyUnless you actually have third party settings to store, I think its fine to init as empty as leave as-is. On a quick grep I did not find a user of entity display level third party settings in core, so it seems to be a contrib extension point.
Why are you adding this commented out?
Comment #14
benjy commentedThey're commented out because I can't get a test to fail yet that proves they're needed but without them, testing a real migration does end up leaving your site with this error.
I have a feeling that this entire issue could be solved by #2220559: Entity displays must have a settings array
Comment #15
benjy commentedI did say in IRC that I thought this was more likely a core bug that the Migrate API exposed and I think that was right. I updated that patch here: https://www.drupal.org/node/2220559#comment-9525761 and that fixes all the problems here with test coverage.
Closing as duplicate unless there is some push back from entity people to initialise third_party_settings for some reason.
Comment #16
gábor hojtsyRetrospective sprint weekend tagging.