Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
5ad6a5e5
Commit
5ad6a5e5
authored
Oct 03, 2014
by
alexpott
Browse files
Issue
#2344103
by Upchuk: Fixed DBLog sort by user is broken.
parent
79d68923
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/dblog/src/Controller/DbLogController.php
View file @
5ad6a5e5
...
...
@@ -140,7 +140,7 @@ public function overview() {
$this
->
t
(
'Message'
),
array
(
'data'
=>
$this
->
t
(
'User'
),
'field'
=>
'u.name'
,
'field'
=>
'u
fd
.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'
]);
...
...
core/modules/dblog/src/Tests/DbLogTest.php
View file @
5ad6a5e5
...
...
@@ -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.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment