diff --git a/core/modules/dblog/dblog.post_update.php b/core/modules/dblog/dblog.post_update.php index 94dc57d..ec6e4ce 100644 --- a/core/modules/dblog/dblog.post_update.php +++ b/core/modules/dblog/dblog.post_update.php @@ -27,6 +27,17 @@ function dblog_post_update_wid_uid_from_numeric_to_standard_fields() { continue; } + $numeric_attributes_to_delete = [ + 'set_precision', + 'precision', + 'decimal', + 'separator', + 'format_plural', + 'format_plural_string', + 'prefix', + 'suffix', + ]; + $save = FALSE; foreach ($view->get('display') as $display_name => $display) { // Iterate through all the fields of watchdog views based tables. @@ -42,7 +53,13 @@ function dblog_post_update_wid_uid_from_numeric_to_standard_fields() { $new_value = $field; $new_value['plugin_id'] = 'standard'; - unset($new_value['separator']); + + // Delete all the attributes related to numeric fields. + foreach ($numeric_attributes_to_delete as $key) { + if (isset($new_value[$key])) { + unset($new_value[$key]); + } + } $view->set("display.$display_name.display_options.fields.$field_name", $new_value); } } diff --git a/core/modules/dblog/src/Tests/Update/DblogUpgradeWidUidFieldsPlugin.php b/core/modules/dblog/src/Tests/Update/DblogUpgradeWidUidFieldsPlugin.php index 8e47119..5695661 100644 --- a/core/modules/dblog/src/Tests/Update/DblogUpgradeWidUidFieldsPlugin.php +++ b/core/modules/dblog/src/Tests/Update/DblogUpgradeWidUidFieldsPlugin.php @@ -38,11 +38,6 @@ public function testDblogUpgradePath() { $this->assertEqual('numeric', $fields['wid']['plugin_id']); $this->assertEqual('numeric', $fields['uid']['plugin_id']); - // The uid relathionship should now join to the {users} table. - $tables = array_keys($view->getBaseTables()); - $this->assertTrue(in_array('users', $tables)); - $this->assertTrue(in_array('watchdog', $tables)); - $this->runUpdates(); $view = Views::getView('dblog_upgrade_test'); @@ -54,7 +49,7 @@ public function testDblogUpgradePath() { $this->assertEqual('standard', $fields['wid']['plugin_id']); $this->assertEqual('standard', $fields['uid']['plugin_id']); - // The uid relathionship should now join to the {users_field_data} table. + // The uid relationship should now join to the {users_field_data} table. $tables = array_keys($view->getBaseTables()); $this->assertTrue(in_array('users_field_data', $tables)); $this->assertFalse(in_array('users', $tables)); diff --git a/core/modules/dblog/tests/modules/dblog_test_views/test_views/views.view.dblog_upgrade_test.yml b/core/modules/dblog/tests/modules/dblog_test_views/test_views/views.view.dblog_upgrade_test.yml index 31b13d8..56d675e 100644 --- a/core/modules/dblog/tests/modules/dblog_test_views/test_views/views.view.dblog_upgrade_test.yml +++ b/core/modules/dblog/tests/modules/dblog_test_views/test_views/views.view.dblog_upgrade_test.yml @@ -433,63 +433,6 @@ display: prefix: '' suffix: '' plugin_id: numeric - wid_1: - id: wid_1 - table: watchdog - field: wid - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: ',' - format_plural: false - format_plural_string: "1\x03@count" - prefix: '' - suffix: '' - plugin_id: numeric filters: severity: id: severity