diff --git a/core/modules/system/tests/modules/update_order_test/update_order_test.install b/core/modules/system/tests/modules/update_order_test/update_order_test.install index b35c6f4..41b9ca7 100644 --- a/core/modules/system/tests/modules/update_order_test/update_order_test.install +++ b/core/modules/system/tests/modules/update_order_test/update_order_test.install @@ -50,4 +50,12 @@ function update_order_test_update_8002() { } } + function update_order_test_update_dependencies() { + // Run this after the views have been updated. + $dependencies['update_order_test'][8001] = array( + 'views' => 8001, + ); + return $dependencies; + } + } diff --git a/core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php b/core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php index 1904838..aa956cc 100644 --- a/core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php +++ b/core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php @@ -188,7 +188,11 @@ public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeI } foreach ($all_views as $view) { - $view->save(); + // All changes done to the views here can be trusted and this might be + // called during updates, when it is not safe to rely on configuration + // containing valid schema. Trust the data and disable schema validation + // and casting. + $view->trustData()->save(); } } diff --git a/core/modules/views/views.install b/core/modules/views/views.install index 2547eed..9539e4d 100644 --- a/core/modules/views/views.install +++ b/core/modules/views/views.install @@ -34,7 +34,7 @@ function views_update_8001(&$sandbox) { foreach (array_keys($displays) as $display_id) { $view->clear("display.$display_id.cache_metadata.cacheable"); } - $view->save(); + $view->save(TRUE); } if (!empty($ids)) {