Closed (fixed)
Project:
Drupal core
Version:
8.5.x-dev
Component:
entity system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2018 at 13:39 UTC
Updated:
12 Oct 2018 at 11:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
claudiu.cristeaThe fix.
Comment #3
claudiu.cristeaComment #4
claudiu.cristeaComment #5
claudiu.cristeaOuch... the failing patch
Comment #6
amateescu commentedThe test-only patch from #5 looks very good, but I'm not sure about the fix. The proposed fix from #2 would require that every computed entity reference field item list to know that it needs to use a different trait than the standard one.
I think this should be better and actually fix all existing computed reference fields without the need for any changes on their part.
It would also mean that we don't need any change record update :)
Comment #7
amateescu commentedComment #9
claudiu.cristea@amateescu, yes that was my first thought but I missed that
->isEmpty()is aware of computed fields so I thought that it would make the method too complex :)Comment #10
claudiu.cristeaUntagged, updated IS.
Comment #11
claudiu.cristeaComment #12
amateescu commentedCool, looks good to me then :)
Comment #13
sam152 commentedThis is an elegant fix, nice!
I also did a quick scan for other instances of
empty($this->list)which could be similarly problematic, but the only occurrence inCommentFieldItemListdoesn't look like it would be appropriate for use with the trait/computed values. +1 RTBC.Comment #14
claudiu.cristeaComment #15
alexpottCommitted and pushed 7896891da5 to 8.6.x and 7dfb2637ff to 8.5.x. Thanks!
Comment #19
jibran