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.
On an autocomplete widget, using the entity's title will not save the entity reference when it should.
This is a port of a D7 entity_reference fix #1959624: Autocomplete widgets not referencing the single entity result.
Comment | File | Size | Author |
---|---|---|---|
#12 | 2247211-psr4-reroll.patch | 3.39 KB | xjm |
#6 | interdiff.txt | 2.96 KB | amateescu |
#6 | autocomplete_ref_fix-2247211-6.patch | 3.67 KB | amateescu |
#6 | autocomplete_ref_fix-2247211-6-test-only.patch | 1.68 KB | amateescu |
Comments
Comment #1
blueminds CreditAttribution: blueminds commentedPlease see the attached ported fix.
Comment #2
amateescu CreditAttribution: amateescu commentedHeh, just when I thought we had good coverage for our widgets :/
Missing a space here :)
Shouldn't this be += ?
This class tests something else entirely, all the widget tests are in
EntityReferenceIntegrationTest
;)Comment #3
blueminds CreditAttribution: blueminds commented1. fixed
2. there is always only one entity type as we can reference only entities of one type. Not sure how to make it more clear.
3. moved
Comment #4
Berdir2. Those aren't entity types, they are bundles. Like article and page. We explicitly want to merge them together, not drop them as you do right now.
Comment #5
blueminds CreditAttribution: blueminds commentedoh, right, i see
Comment #6
amateescu CreditAttribution: amateescu commentedI think it would be much easier to test this by updating the input values inserted a few lines above in that method. Something like this interdiff :)
Comment #8
BerdirTest coverage looks good to me. I worked on the initial patch in the 7.x issue but I think @amateescu would have said something if the fix wouldn't be OK :)
Comment #10
amateescu CreditAttribution: amateescu commented6: autocomplete_ref_fix-2247211-6.patch queued for re-testing.
Comment #11
amateescu CreditAttribution: amateescu commentedBot fluke, back to RTBC.
Comment #12
xjmReroll for #2247991: [May 27] Move all module code from …/lib/Drupal/… to …/src/… for PSR-4.
Comment #13
alexpottCommitted 6e7dfbc and pushed to 8.x. Thanks!