2015-10-02 08:26:50 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Post update functions for Views.
|
|
|
|
*/
|
|
|
|
|
2020-04-06 11:28:45 +00:00
|
|
|
use Drupal\Core\Config\Entity\ConfigEntityUpdater;
|
|
|
|
use Drupal\views\ViewsConfigUpdater;
|
|
|
|
|
2018-02-18 16:10:25 +00:00
|
|
|
/**
|
2020-03-11 20:58:38 +00:00
|
|
|
* Implements hook_removed_post_updates().
|
|
|
|
*/
|
|
|
|
function views_removed_post_updates() {
|
|
|
|
return [
|
|
|
|
'views_post_update_update_cacheability_metadata' => '9.0.0',
|
|
|
|
'views_post_update_cleanup_duplicate_views_data' => '9.0.0',
|
|
|
|
'views_post_update_field_formatter_dependencies' => '9.0.0',
|
|
|
|
'views_post_update_taxonomy_index_tid' => '9.0.0',
|
|
|
|
'views_post_update_serializer_dependencies' => '9.0.0',
|
|
|
|
'views_post_update_boolean_filter_values' => '9.0.0',
|
|
|
|
'views_post_update_grouped_filters' => '9.0.0',
|
|
|
|
'views_post_update_revision_metadata_fields' => '9.0.0',
|
|
|
|
'views_post_update_entity_link_url' => '9.0.0',
|
|
|
|
'views_post_update_bulk_field_moved' => '9.0.0',
|
|
|
|
'views_post_update_filter_placeholder_text' => '9.0.0',
|
|
|
|
'views_post_update_views_data_table_dependencies' => '9.0.0',
|
|
|
|
'views_post_update_table_display_cache_max_age' => '9.0.0',
|
|
|
|
'views_post_update_exposed_filter_blocks_label_display' => '9.0.0',
|
|
|
|
'views_post_update_make_placeholders_translatable' => '9.0.0',
|
|
|
|
'views_post_update_limit_operator_defaults' => '9.0.0',
|
|
|
|
'views_post_update_remove_core_key' => '9.0.0',
|
|
|
|
];
|
2019-10-22 19:40:16 +00:00
|
|
|
}
|
2020-04-06 11:28:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Update field names for multi-value base fields.
|
|
|
|
*/
|
|
|
|
function views_post_update_field_names_for_multivalue_fields(&$sandbox = NULL) {
|
|
|
|
/** @var \Drupal\views\ViewsConfigUpdater $view_config_updater */
|
|
|
|
$view_config_updater = \Drupal::classResolver(ViewsConfigUpdater::class);
|
|
|
|
$view_config_updater->setDeprecationsEnabled(FALSE);
|
|
|
|
\Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function ($view) use ($view_config_updater) {
|
|
|
|
return $view_config_updater->needsMultivalueBaseFieldUpdate($view);
|
|
|
|
});
|
|
|
|
}
|
2020-07-13 12:12:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear errors caused by relationships to configuration entities.
|
|
|
|
*/
|
|
|
|
function views_post_update_configuration_entity_relationships() {
|
|
|
|
// Empty update to clear Views data.
|
|
|
|
}
|