diff --git a/core/modules/dblog/config/optional/views.view.watchdog.yml b/core/modules/dblog/config/optional/views.view.watchdog.yml deleted file mode 100644 index b16b3762aca6ee1798b731b02d9dfa95ef64ae14..0000000000000000000000000000000000000000 --- a/core/modules/dblog/config/optional/views.view.watchdog.yml +++ /dev/null @@ -1,722 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - dblog - - user -id: watchdog -label: Watchdog -module: views -description: 'Recent log messages' -tag: '' -base_table: watchdog -base_field: wid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access site reports' - cache: - type: none - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Filter - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: false - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 50 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '{{ type }} {{ severity }}' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - nothing: nothing - wid: wid - severity: severity - type: type - timestamp: timestamp - message: message - name: name - link: link - info: - nothing: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-medium - wid: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-low - severity: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-low - type: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-medium - timestamp: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: priority-low - message: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-medium - name: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-medium - link: - align: '' - separator: '' - empty_column: false - responsive: priority-low - default: timestamp - empty_table: false - row: - type: fields - fields: - nothing: - id: nothing - table: views - field: nothing - relationship: none - group_type: group - admin_label: Icon - label: '' - exclude: false - alter: - alter_text: true - 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: icon - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: false - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: false - plugin_id: custom - wid: - id: wid - table: watchdog - field: wid - relationship: none - group_type: group - admin_label: '' - label: WID - exclude: true - 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: true - 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: '' - entity_type: null - entity_field: null - plugin_id: numeric - severity: - id: severity - table: watchdog - field: severity - relationship: none - group_type: group - admin_label: '' - label: 'Severity level' - exclude: true - 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: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - machine_name: false - plugin_id: machine_name - type: - id: type - table: watchdog - field: type - relationship: none - group_type: group - admin_label: '' - label: Type - 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: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: standard - timestamp: - id: timestamp - table: watchdog - field: timestamp - relationship: none - group_type: group - admin_label: '' - label: Date - 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: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: short - custom_date_format: '' - timezone: '' - plugin_id: date - message: - id: message - table: watchdog - field: message - relationship: none - group_type: group - admin_label: '' - label: Message - exclude: false - alter: - alter_text: false - text: '' - make_link: true - path: 'admin/reports/dblog/event/{{ wid }}' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '{{ message }}' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 56 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: true - trim: true - preserve_tags: '' - html: true - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - replace_variables: true - plugin_id: dblog_message - name: - id: name - table: users_field_data - field: name - relationship: uid - group_type: group - admin_label: '' - label: User - 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: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: user_name - settings: - link_to_entity: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: user - entity_field: name - plugin_id: field - link: - id: link - table: watchdog - field: link - relationship: none - group_type: group - admin_label: '' - label: Operations - 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: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: dblog_operations - filters: - type: - id: type - table: watchdog - field: type - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: type_op - label: Type - description: '' - use_operator: false - operator: type_op - identifier: type - required: false - remember: false - multiple: true - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: in_operator - severity: - id: severity - table: watchdog - field: severity - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: severity_op - label: 'Severity level' - description: '' - use_operator: false - operator: severity_op - identifier: severity - required: false - remember: false - multiple: true - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: in_operator - sorts: - timestamp: - id: timestamp - table: watchdog - field: timestamp - order: DESC - entity_type: null - entity_field: null - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: 'Recent log messages' - header: { } - footer: { } - empty: - area: - id: area - table: views - field: area - relationship: none - group_type: group - admin_label: '' - empty: true - tokenize: false - content: - value: 'No log messages available.' - format: basic_html - plugin_id: text - relationships: - uid: - id: uid - table: watchdog - field: uid - relationship: none - group_type: group - admin_label: User - required: false - plugin_id: standard - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: - 1: AND - css_class: admin-dblog - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } - page: - display_plugin: page - id: page - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: admin/reports/dblog - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module index 7116f92c9c854aa1538c68aee9e0f3e8aafde6f6..06fef103fe5512ec1237562d8e42fcf964891bdb 100644 --- a/core/modules/dblog/dblog.module +++ b/core/modules/dblog/dblog.module @@ -115,12 +115,3 @@ function dblog_form_system_logging_settings_alter(&$form, FormStateInterface $fo function dblog_logging_settings_submit($form, FormStateInterface $form_state) { \Drupal::configFactory()->getEditable('dblog.settings')->set('row_limit', $form_state->getValue('dblog_row_limit'))->save(); } - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function dblog_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) { - if ($form_state->get('view')->id() == 'watchdog') { - $form['#attached']['library'][] = 'dblog/drupal.dblog'; - } -} diff --git a/core/modules/dblog/dblog.post_update.php b/core/modules/dblog/dblog.post_update.php deleted file mode 100644 index d3ffdffe89e566ae5187a04d33083c5160cb01fb..0000000000000000000000000000000000000000 --- a/core/modules/dblog/dblog.post_update.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/** - * @file - * Post update functions for the Database Logging module. - */ - -use Drupal\Core\Config\FileStorage; -use Drupal\Core\Config\InstallStorage; -use Drupal\views\Entity\View; - -/** - * @addtogroup updates-8.3.x - * @{ - */ - -/** - * Replace 'Recent log messages' with a view. - */ -function dblog_post_update_convert_recent_messages_to_view() { - // Only create if the views module is enabled and the watchdog view doesn't - // exist. - if (\Drupal::moduleHandler()->moduleExists('views')) { - if (!View::load('watchdog')) { - // Save the watchdog view to config. - $module_handler = \Drupal::moduleHandler(); - $optional_install_path = $module_handler->getModule('dblog')->getPath() . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY; - $storage = new FileStorage($optional_install_path); - - \Drupal::entityTypeManager() - ->getStorage('view') - ->create($storage->read('views.view.watchdog')) - ->save(); - - return t('The watchdog view has been created.'); - } - - return t("The watchdog view already exists and was not replaced. To replace the 'Recent log messages' with a view, rename the watchdog view and uninstall and install the 'Database Log' module"); - } -} - -/** - * @} End of "addtogroup updates-8.3.x". - */ diff --git a/core/modules/dblog/dblog.views.inc b/core/modules/dblog/dblog.views.inc index 25b6222dd063b12c73d4a83521e114c252b99a48..dfc1fdec3f70ae5facdb3dc581d079550a285a4e 100644 --- a/core/modules/dblog/dblog.views.inc +++ b/core/modules/dblog/dblog.views.inc @@ -20,14 +20,6 @@ function dblog_views_data() { 'help' => t('Contains a list of log entries.'), ); - $data['watchdog']['table']['join'] = array( - // Link ourselves to the {users_field_data} table - 'users_field_data' => array( - 'field' => 'uid', - 'left_field' => 'uid', - ), - ); - $data['watchdog']['wid'] = array( 'title' => t('WID'), 'help' => t('Unique watchdog event ID.'), @@ -47,6 +39,7 @@ function dblog_views_data() { $data['watchdog']['uid'] = array( 'title' => t('UID'), + 'help' => t('The user ID of the user on which the log entry was written..'), 'field' => array( 'id' => 'numeric', ), @@ -59,9 +52,8 @@ function dblog_views_data() { 'relationship' => array( 'title' => t('User'), 'help' => t('The user on which the log entry as written.'), - 'base' => 'users_field_data', + 'base' => 'users', 'base field' => 'uid', - 'field' => 'uid', 'id' => 'standard', ), ); @@ -128,7 +120,7 @@ function dblog_views_data() { ), 'filter' => array( 'id' => 'in_operator', - 'options callback' => 'Drupal\Core\Logger\RfcLogLevel::getLevels', + 'options callback' => 'Drupal\dblog\Controller\DbLogController::getLogLevelClassMap', ), 'sort' => array( 'id' => 'standard', diff --git a/core/modules/dblog/src/Tests/DbLogTest.php b/core/modules/dblog/src/Tests/DbLogTest.php index 77678d6293b9f72f265c2c03ba0a46aab515e536..daa9421b73172c896a18b78d16177f4511480089 100644 --- a/core/modules/dblog/src/Tests/DbLogTest.php +++ b/core/modules/dblog/src/Tests/DbLogTest.php @@ -281,12 +281,6 @@ private function verifyReports($response = 200) { $this->assertText(t('Recent log messages'), 'DBLog report was displayed'); } - $this->drupalGet('admin/reports/dblog/confirm'); - $this->assertResponse($response); - if ($response == 200) { - $this->assertText(t('Are you sure you want to delete the recent logs?'), 'DBLog clear logs form was displayed'); - } - // View the database log page-not-found report page. $this->drupalGet('admin/reports/page-not-found'); $this->assertResponse($response); @@ -827,7 +821,7 @@ public function testOverviewLinks() { $this->drupalGet('admin/reports/dblog'); $this->assertResponse(200); // Make sure HTML tags are filtered out. - $this->assertRaw('title="alert('foo');Lorem'); + $this->assertRaw('title="alert('foo');Lorem ipsum dolor sit amet, consectetur adipiscing & elit. Entry #0"><script>alert('foo');</script>Lorem ipsum dolor sit…</a>'); $this->assertNoRaw("<script>alert('foo');</script>"); // Make sure HTML tags are filtered out in admin/reports/dblog/event/ too. diff --git a/core/modules/dblog/src/Tests/DbLogViewsTest.php b/core/modules/dblog/src/Tests/DbLogViewsTest.php deleted file mode 100644 index 53284ca2626fce3070508944d1ba4a1c6d817501..0000000000000000000000000000000000000000 --- a/core/modules/dblog/src/Tests/DbLogViewsTest.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -namespace Drupal\dblog\Tests; - -use Drupal\filter\Entity\FilterFormat; - -/** - * Generate events and verify dblog entries; verify user access to log reports - * based on permissions. Using the dblog UI generated by a View. - * - * @see Drupal\dblog\Tests\DbLogTest - * - * @group dblog - */ -class DbLogViewsTest extends DbLogTest { - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = array('dblog', 'node', 'forum', 'help', 'block', 'views'); - - /** - * {@inheritdoc} - */ - protected function getLogsEntriesTable() { - return $this->xpath('.//table[contains(@class, "views-view-table")]'); - } - - /** - * {@inheritdoc} - */ - protected function filterLogsEntries($type = NULL, $severity = NULL) { - $query = array(); - if (!is_null($type)) { - $query['type[]'] = $type; - } - if (!is_null($severity)) { - $query['severity[]'] = $severity; - } - - $this->drupalGet('admin/reports/dblog', array('query' => $query)); - } - - /** - * {@inheritdoc} - */ - public function testDBLogAddAndClear() { - // Is necesary to create the basic_html format because if absent after - // delete the logs, a new log entry is created indicating that basic_html - // format do not exists. - $basic_html_format = FilterFormat::create(array( - 'format' => 'basic_html', - 'name' => 'Basic HTML', - 'filters' => array( - 'filter_html' => array( - 'status' => 1, - 'settings' => array( - 'allowed_html' => '<p> <br> <strong> <a> <em>', - ), - ), - ), - )); - $basic_html_format->save(); - - parent::testDBLogAddAndClear(); - } - -} diff --git a/core/modules/dblog/src/Tests/Update/DblogRecentLogsUsingViewsUpdateTest.php b/core/modules/dblog/src/Tests/Update/DblogRecentLogsUsingViewsUpdateTest.php deleted file mode 100644 index f81ab0e7448ae9e1578cf4e5f797eba02a68f1ae..0000000000000000000000000000000000000000 --- a/core/modules/dblog/src/Tests/Update/DblogRecentLogsUsingViewsUpdateTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\dblog\Tests\Update; - -use Drupal\system\Tests\Update\UpdatePathTestBase; - -/** - * Ensures that update hook that creates the watchdog view ran sucessfully. - * - * @group Update - */ -class DblogRecentLogsUsingViewsUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Ensures that update hook is run for dblog module. - */ - public function testUpdate() { - // Make sure the watchog view doesn't exist before the updates. - $view = \Drupal::entityTypeManager()->getStorage('view')->load('watchdog'); - $this->assertNull($view); - - $this->runUpdates(); - - // Ensure the watchdog view is present after run updates. - $view = \Drupal::entityTypeManager()->getStorage('view')->load('watchdog'); - $displays = $view->get('display'); - $this->assertIdentical($displays['page']['display_options']['path'], 'admin/reports/dblog', 'Recent logs message view exists.'); - } - -} diff --git a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php index 8e1f3ab0fbc70f2aedf311d4b0fe42ba7f6e236d..50829f026840defaa78675c52a7f26864b2f6f5b 100644 --- a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php +++ b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php @@ -63,7 +63,7 @@ protected function getEntityCounts() { 'user' => 7, 'user_role' => 6, 'menu_link_content' => 4, - 'view' => 13, + 'view' => 12, 'date_format' => 11, 'entity_form_display' => 15, 'entity_form_mode' => 1, diff --git a/core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php b/core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php index 99b29eef5153b21502a14533a2f3b01521c8e3c5..77bc2ab86f8c98b0026a82004999c9359c1c9030 100644 --- a/core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php +++ b/core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php @@ -64,7 +64,7 @@ protected function getEntityCounts() { 'user' => 4, 'user_role' => 3, 'menu_link_content' => 7, - 'view' => 13, + 'view' => 12, 'date_format' => 11, 'entity_form_display' => 16, 'entity_form_mode' => 1,