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.
* Add Er field to article
* Try to reference another article -- autocomplete JS doesn't seem to be attached to the text field.
Comment | File | Size | Author |
---|---|---|---|
#21 | 2084081-21.patch | 4.95 KB | amateescu |
#18 | 2084081-test-only.patch | 1.51 KB | amateescu |
#18 | 2084081-18.patch | 4.97 KB | amateescu |
#11 | 2084081-11.patch | 3.46 KB | amateescu |
#11 | interdiff.txt | 792 bytes | amateescu |
Comments
Comment #1
amateescu CreditAttribution: amateescu commentedHere's the fix.
Comment #2
aspilicious CreditAttribution: aspilicious commentedCan we write a test for this?
Comment #3
amateescu CreditAttribution: amateescu commentedI couldn't figute out a way to test it.. :/
Comment #4
amitaibu* Deprecate Taxonomy term field
* Enable entity-reference by default -- then everybody would see it doesn't work :P
Comment #5
amateescu CreditAttribution: amateescu commentedYeah, I wanted to do this for a while: #2084309: Enable Entity reference in the standard profile
Comment #6
andymartha CreditAttribution: andymartha commentedHmm, after applying patch 2084081.patch in #1 by amateescu, I haven't noticed any difference. I don't see an AJAX auto-complete when trying to follow the instructions in issue summary (see screenshot).
Comment #7
amateescu CreditAttribution: amateescu commented@andymartha, it still works for me, and I only had to refresh the page after applying the patch. Are you sure you have another article to reference so the autocomplete can return something?
I thought about tests some more and we really don't have a way to test this kind of AJAX stuff, so we have to rely on manual testing here.
Comment #8
amitaibuWorks as expected.
Comment #9
amitaibufyi #2085931: Autocomplete tags style is broken for multiple values
Comment #10
yched CreditAttribution: yched commentedCan we remove the if ($entity) part ?
There is always an $entity, the code calls its ->entityType() & ->bundle() methods a couple lines above.
Comment #11
amateescu CreditAttribution: amateescu commentedSure thing.
Comment #12
dawehnerAre we sure that we don't want to write a test for that?
Comment #13
amateescu CreditAttribution: amateescu commentedI never said I don't want to, just don't know *how* to :)
Comment #14
dawehnerThis kind of tests exists at least in two places, so feel free to spread the word: core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php
Comment #15
amateescu CreditAttribution: amateescu commentedI'm looking at that test class and all I see is testing an already populated select list, nothing to do with an Ajax autocomplete.
Comment #16
dawehnerSee
Comment #17
webchickYep.
Comment #18
amateescu CreditAttribution: amateescu commentedRight, I had to pull the latest code because that hunk you pasted was only committed yesterday. And it led me in the right direction because I could see a difference in the html output of the element, the one that works has a 'form-autocomplete' class. Thanks for the pointer :)
Comment #19
dawehnerWat? You are the maintainer of EntityReference ... but the main reason why I didn't just jumped in was that I could not find a testfile where this fits in :)
Maybe at least create a new test method?
Comment #20
amateescu CreditAttribution: amateescu commentedAnd add a few more seconds to the testing time just for those two lines? No way :)
Comment #21
amateescu CreditAttribution: amateescu commentedRerolled.
Comment #23
amateescu CreditAttribution: amateescu commented#21: 2084081-21.patch queued for re-testing.
Comment #24
dawehnerYeah let's not waste time on the testbot.
Comment #25
David Hernández CreditAttribution: David Hernández commented#21: 2084081-21.patch queued for re-testing.
Comment #26
alexpottCommitted 75b8c06 and pushed to 8.x. Thanks!