Problem/Motivation
When a field gets added or removed from a View, the table info never gets updated to represent the new settings, which means that this info can contain completely irrelevant settings.
The settings only get updated once you open the style settings and save them.
Adding a yml file of an exported View that illustrates the problem. The style: info: contains settings for fields that are no longer present on the View and no settings for the field that is.
Steps to reproduce:
- Create a content View
- Set the style to table
- add a field
- Remove the title field
- Save the view
- export the view and check the display_options: style: info: settings. the title settings are there and no settings for the newly added field.
Proposed resolution
Make the settings be up-to-date
Remaining tasks
everything
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2917814-2-TEST_ONLY.patch | 1.13 KB | lendude |
| views.view_.text_plain_long.yml | 4.77 KB | lendude |
Comments
Comment #2
lendudeNot sure if we want to tackle this on the Views UI or on the entity level, but ideally I'd say on the entity level, so something like this should pass.
Comment #8
dwwCame upon this issue from #2223195: Views "Global: Custom text" field handler should not be sortable, which I learned of via #bugsmash, so tagging this one, too.
Great find for this bug, and nice to have a test already for it! Love encountering issues that are the inverse of "Needs tests". Here, we've got: "Has test, needs fix"... 😉
Sadly, this is going to be a super complicated bug to fix cleanly in production, since writing an update path for it will be extremely hard. Not sure what we can do, since we can't really know what the site builder intended. We can certainly go in and purge any settings for fields that are gone, but I don't know what we can do for fields that are in the view but not in the table settings. Yuck.
I think we might need some direction from release managers or product maintainers on if/how to go about trying to solve this.
Thanks,
-Derek
Comment #9
lendude+1 Everything in #8, plus, currently this data really only lives in a UI Form, so my hope in #2 of doing this at the entity level might be wildly optimistic