Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Entity reference field configs saved before #2448503: Convert the "Field edit" form to an actual entity form are still containing the stale settings.handler_submit
key.
Proposed resolution
Remove the stale 'handler_submit' setting form the ER field configs.
Remaining tasks
- Write post update hook to fix the ER config.
- Update path tests.
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#21 | 2715589-21.patch | 4.24 KB | claudiu.cristea |
#21 | 2715589-21.interdiff.txt | 3.3 KB | claudiu.cristea |
Comments
Comment #2
jibranHere is the patch to start the party.
Comment #3
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThe patch looks good, it simply brings back a line of code that was removed by accident.
Would you like to write the upgrade path and maybe the tests as well so we can bring this issue to completion? :)
Comment #4
jibranAdded upgrade path.
Comment #6
jibranMoving to right component
Comment #7
Berdirisn't is_subclass_of() enough?
Needs work for a reroll and tests. Otherwise makes sense.
Comment #8
claudiu.cristea@Berdir, no,
is_subclass_of()
doesn't catch the class itself. For exampleis_subclass_of(EntityReferenceItem::class, EntityReferenceItem::class)
returnsFALSE
.Comment #9
claudiu.cristeaOuch, the patch!
Comment #10
jibranPlease don't use it DER extend this class but stores settings differently.NVM said it to soon.Comment #11
jibranIf we are going to use post update hook then we can use field type manager to load the fields by type.
Comment #12
claudiu.cristeaComment #15
claudiu.cristeaI cannot reproduce anymore this bug. All form buttons are removed from the form state values in
\Drupal\Core\Entity\EntityForm::submitForm()
, specifically in the$form_state->cleanValues();
. I think we should keep only the part that updates the DB.Comment #16
claudiu.cristeaThe issue has been fixed in #2448503: Convert the "Field edit" form to an actual entity form, we are only updating stale settings in field configs.
Comment #17
jibranTest looks good there is some debug code left in the patch. Can we please also address #11?
Comment #18
claudiu.cristeaComment #19
jibranThanks, this is ready.
Comment #20
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedIs there any reason for not putting this test inside
\Drupal\Tests\field\Functional\Update\FieldUpdateTest
where we have all the other field update tests?Comment #21
claudiu.cristeaOk, ok.
Comment #22
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedAwesome :)
Comment #26
jibran