Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
field_ui.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2017 at 14:32 UTC
Updated:
8 Nov 2018 at 21:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tacituseu commentedTracked down to
core/modules/field_ui/field_ui.es6.js:Looks like it was changed in #2796581-130: Fields must store their region in entity displays, and is an unintended consequence of removing
- Hidden -formatter, the previous behaviour was to only reset it when the field was un-hidden (see: 962eddec).Comment #3
tim.plunkettCan you reproduce without Field Layout? If you tracked it to that file, it could be a wider bug in Field UI.
Comment #4
tacituseu commentedWithout Field Layout there are only 2 regions 'Content' and 'Disabled', and then it sort of matches the previous behavior, with an added quirk though: when you move field 'Tags' from 'Content' to 'Disabled', formatter is reset to 'Label', but when you save it it changes to 'Rendered entity'.
Edit:
By previous behavior I mean, I recall it used to be that moving to 'Disabled' changed formatter to '- Hidden -', and moving out of 'Disabled' it was setting it to default, but I would not expect this when moving it between 'normal' regions.
Comment #6
tacituseu commentedPatch resets to default formatter only when field is moved out of 'Disabled' region, when moving between visible/displayed regions it preserves it.
Comment #8
tim.plunkettComment #9
borisson_Comment #10
anybodyThis is a really nasty bug which already cost us a lot of time. We're happy to confirm this is RTBC. We tested it in several environments. It would be great to have this in the next core release!
Comment #11
tim.plunkettGood catch, this was broken in #2796581: Fields must store their region in entity displays.
And yes, it's only reproducible when there are multiple regions, hence the need for Field Layout.
But the bug is in Field UI itself.
Ideally this would get functional JS test coverage, but I'm not sure that it's required.
Comment #13
tacituseu commentedBot acting up.
Comment #14
alexpottif we've broken it once we should definitely add test coverage.
Comment #15
alexpottComment #16
anybodyWe're using the patch successfully since month now. It works great and fixes the problems.
So this should definitely become part of 8.6.x.
If I know how to write the tests I'd do it, but I fear it would be trial and error. :( Could someone perhaps point to a similar / reference implementation or mentor me for that?
All in all RTBC but missing tests.
Comment #18
anybodyRerolled patch against 8.7.x
Comment #19
anybodyComment #21
tim.plunkettStill needs tests
Comment #22
anybody@tim.plunkett, sorry. If someone could give me a first code example how to write these tests correctly, I'd like to write them / add further tests. I'm not experienced in that yet.
Comment #23
tim.plunkettHere's a test (the FAIL patch is the interdiff)
Comment #25
borisson_The test seems to cover everything and the patch I uploaded was absolutely useless - so I think I can RTBC this.
Comment #26
anybodyWhao thank you so much for mentoring, tim.plunkett, I've learned a lot in the last issues you commented and the next time I'll be able to write the given tests on my own. I'll have a look if I see demand for further tests in this case, otherwise confirming RTBC. THANK YOU!!
Works on 8.6.x and 8.7.x
Comment #29
larowlanCommitted 1f03271 and pushed to 8.7.x. Thanks!
Cherry picked as 27229b5a37 to 8.6.x