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.
Problem/Motivation
On update to core 8.4, the postupdate code below (run via drush) smashed all my views config, by replacing all strings with a translated version like this:
- title: 'Monthly archive'
+ title: 'Monatliches Archiv'
It looks like the language overrides get saved.
To reproduce (i guess the language setting is important):
* set english as default language
* set (e.g.) german as default negotiation language
* have a view with translated title
* load and re-save the view
/**
* Fix table names for revision metadata fields.
*/
function views_post_update_revision_metadata_fields() {
// The table names are fixed automatically in
// \Drupal\views\Entity\View::preSave(), so we just need to re-save all views.
$views = View::loadMultiple();
array_walk($views, function (View $view) {
$view->save();
});
}
Proposed resolution
* Find and crosslink the issue(s) about config override saving
* Check if they fix this OR we must make views leverage this
* Decide what to do with the upgrade path
Remaining tasks
TBD
User interface changes
None
API changes
TBD
Data model changes
TBD
Comments