Commit 5ad6a5e5 authored by alexpott's avatar alexpott
Browse files

Issue #2344103 by Upchuk: Fixed DBLog sort by user is broken.

parent 79d68923
......@@ -140,7 +140,7 @@ public function overview() {
$this->t('Message'),
array(
'data' => $this->t('User'),
'field' => 'u.name',
'field' => 'ufd.name',
'class' => array(RESPONSIVE_PRIORITY_MEDIUM)),
array(
'data' => $this->t('Operations'),
......@@ -160,6 +160,7 @@ public function overview() {
'variables',
'link',
));
$query->leftJoin('users_field_data', 'ufd', 'w.uid = ufd.uid');
if (!empty($filter['where'])) {
$query->where($filter['where'], $filter['args']);
......
......@@ -65,6 +65,14 @@ function testDbLog() {
$this->verifyEvents();
$this->verifyReports();
$this->verifyBreadcrumbs();
// Verify the overview table sorting.
$orders = array('Date', 'Type', 'User');
$sorts = array('asc', 'desc');
foreach ($orders as $order) {
foreach ($sorts as $sort) {
$this->verifySort($sort, $order);
}
}
// Login the regular user.
$this->drupalLogin($this->any_user);
......@@ -217,6 +225,20 @@ private function verifyEvents() {
// set to zero.
}
/**
* Verifies the sorting functionality of the database logging reports table.
*
* @param string $sort
* The sort direction.
* @param string $order
* The order by which the table should be sorted.
*/
public function verifySort($sort = 'asc', $order = 'Date') {
$this->drupalGet('admin/reports/dblog', array('query' => array('sort' => $sort, 'order' => $order)));
$this->assertResponse(200);
$this->assertText(t('Recent log messages'), 'DBLog report was displayed correctly and sorting went fine.');
}
/**
* Generates and then verifies some user events.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment