Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
ea6242d5
Commit
ea6242d5
authored
Dec 17, 2010
by
Angie Byron
Browse files
#993026
by bblake, agentrickard: Fixed Default sort on admin/content incorrect
parent
1bd3670b
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/tablesort.inc
View file @
ea6242d5
...
...
@@ -80,7 +80,7 @@ protected function getSort() {
// User has not specified a sort. Use default if specified; otherwise use "asc".
else
{
foreach
(
$this
->
header
as
$header
)
{
if
(
isset
(
$header
[
'sort'
]))
{
if
(
is_array
(
$header
)
&&
isset
(
$header
[
'sort'
]))
{
return
$header
[
'sort'
];
}
}
...
...
modules/node/node.test
View file @
ea6242d5
...
...
@@ -1409,6 +1409,20 @@ class NodeAdminTestCase extends DrupalWebTestCase {
$this
->
drupalCreateNode
(
array
(
'title'
=>
$prefix
.
$this
->
randomName
(
6
)));
}
// Test that the default sort by node.changed DESC actually fires properly.
$nodes_query
=
db_select
(
'node'
,
'n'
)
->
fields
(
'n'
,
array
(
'nid'
))
->
orderBy
(
'changed'
,
'DESC'
)
->
execute
()
->
fetchCol
();
$nodes_form
=
array
();
$this
->
drupalGet
(
'admin/content'
);
foreach
(
$this
->
xpath
(
'//table/tbody/tr/td/div/input/@value'
)
as
$input
)
{
$nodes_form
[]
=
$input
;
}
$this
->
assertEqual
(
$nodes_query
,
$nodes_form
,
'Nodes are sorted in the form according to the default query.'
);
// Compare the rendered HTML node list to a query for the nodes ordered by
// title to account for possible database-dependent sort order.
$nodes_query
=
db_select
(
'node'
,
'n'
)
...
...
@@ -1417,6 +1431,7 @@ class NodeAdminTestCase extends DrupalWebTestCase {
->
execute
()
->
fetchCol
();
$nodes_form
=
array
();
$this
->
drupalGet
(
'admin/content'
,
array
(
'query'
=>
array
(
'sort'
=>
'asc'
,
'order'
=>
'Title'
)));
foreach
(
$this
->
xpath
(
'//table/tbody/tr/td/div/input/@value'
)
as
$input
)
{
$nodes_form
[]
=
$input
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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