diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module index bc35f36..5318a34 100644 --- a/core/modules/dblog/dblog.module +++ b/core/modules/dblog/dblog.module @@ -136,7 +136,7 @@ function _dblog_get_message_types() { $types[] = $object->type; } - return $types; + return drupal_map_assoc($types); } /** diff --git a/core/modules/dblog/dblog.views.inc b/core/modules/dblog/dblog.views.inc index e8cae28..a121a57 100644 --- a/core/modules/dblog/dblog.views.inc +++ b/core/modules/dblog/dblog.views.inc @@ -17,7 +17,7 @@ function dblog_views_data() { $data['watchdog']['table']['base'] = array( 'field' => 'wid', - 'title' => t('Watchdog event'), + 'title' => t('Watchdog events'), 'help' => t('Contains a list of log entries.'), ); @@ -34,6 +34,9 @@ function dblog_views_data() { 'argument' => array( 'id' => 'numeric', ), + 'sort' => array( + 'id' => 'standard', + ), 'search' => array( 'id' => 'standard', ), @@ -69,12 +72,14 @@ function dblog_views_data() { 'help' => t('The of the log entry, for example "user" or "page not found.".'), 'field' => array( 'id' => 'standard', + 'click sortable' => TRUE, ), 'argument' => array( 'id' => 'string', ), 'filter' => array( - 'id' => 'string', + 'id' => 'in_operator', + 'options callback' => '_dblog_get_message_types', ), 'sort' => array( 'id' => 'standard', @@ -120,13 +125,16 @@ function dblog_views_data() { 'help' => t('The severity level of the event; ranges from 0 (Emergency) to 7 (Debug).'), 'field' => array( 'id' => 'machine_name', - 'options callback' => 'dblog_views_severity_options_callback' + 'click sortable' => TRUE, + 'options callback' => 'dblog_views_severity_options_callback', ), 'filter' => array( 'id' => 'in_operator', - 'options callback' => 'dblog_views_severity_options_callback' + 'options callback' => 'dblog_views_severity_options_callback', + ), + 'sort' => array( + 'id' => 'standard', ), - ); $data['watchdog']['link'] = array( diff --git a/core/modules/dblog/lib/Drupal/dblog/Plugin/views/field/DblogMessage.php b/core/modules/dblog/lib/Drupal/dblog/Plugin/views/field/DblogMessage.php index f674ef4..15fd715 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Plugin/views/field/DblogMessage.php +++ b/core/modules/dblog/lib/Drupal/dblog/Plugin/views/field/DblogMessage.php @@ -67,7 +67,7 @@ function render($values) { if ($this->options['replace_variables']) { $variables = unserialize($this->get_value($values, 'variables')); - return format_string($value, $variables); + return format_string($value, $variables ? $variables : array()); } else { return $this->sanitizeValue($value); diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php index d752239..41baf5e 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php +++ b/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php @@ -7,13 +7,13 @@ namespace Drupal\dblog\Tests\Views; -use Drupal\views\Tests\ViewUnitTestBase; +use Drupal\views\Tests\ViewTestBase; use Drupal\views\Tests\ViewTestData; /** * Tests the views integration of dblog module. */ -class ViewsIntegrationTest extends ViewUnitTestBase { +class ViewsIntegrationTest extends ViewTestBase { /** * Views used by this test. diff --git a/core/modules/dblog/tests/dblog_test_views/test_views/views.view.test_dblog.yml b/core/modules/dblog/tests/dblog_test_views/test_views/views.view.test_dblog.yml index ff434e3..1d5db8f 100755 --- a/core/modules/dblog/tests/dblog_test_views/test_views/views.view.test_dblog.yml +++ b/core/modules/dblog/tests/dblog_test_views/test_views/views.view.test_dblog.yml @@ -83,7 +83,7 @@ display: display_title: Page position: '' display_options: - path: test-path + path: test-dblog human_name: test_dblog module: views name: test_dblog