Problem/Motivation
Follow-up from #2851293: dblog is using the wrong views field, filter and relationships definitions. See also #2784233: Allow multiple vocabularies in the taxonomy filter and #2810097: Allow views to provide the canonical entity URL of all entities, not just nodes..
When we update the structure of configuration entities, we've been generally doing it the following way:
1. Add a backwards compatibility layer in hook_ENTITY_TYPE_presave()
2. Add a hook_post_update_X() that only loads and saves the views.
The advantage of this, is that the bc layer then fixes default configuration entities provided by contrib and custom modules get automatically fixed by the bc layer.
Once we have https://www.drupal.org/core/deprecation and test integration in place, deprecatio notices in the bc layer will inform module maintainers they need to re-export their default configuration.
However there are two issues:
1. It's completely the opposite approach to how we write updates for everything else - usually we fix the data in the update, not just as a side effect of loading and re-saving.
2. The documentation on https://www.drupal.org/core/deprecation doesn't mention this (it's also very long).
Proposed resolution
Update the documentation for now, possibly with a FAQ for why we do it this way.
Comments
Comment #2
catchComment #3
catchComment #4
Lendude#2459289: Boolean default values are not saved is one where we didn't do this and I remember seeing a IRC discussion how this made every contrib test suite fail that used Views with boolean filters.
I would be a bit concerned that something like views_view_presave() could become pretty big, unreadable and hard to maintain over time.
Would it be an idea to implement hook_hook_info() for hook_ENTITY_TYPE_presave so we don't have to bloat the .module file?