Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3485117
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3485117
Commits
ea6242d5
Commit
ea6242d5
authored
14 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#993026
by bblake, agentrickard: Fixed Default sort on admin/content incorrect
parent
1bd3670b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
includes/tablesort.inc
+1
-1
1 addition, 1 deletion
includes/tablesort.inc
modules/node/node.test
+15
-0
15 additions, 0 deletions
modules/node/node.test
with
16 additions
and
1 deletion
includes/tablesort.inc
+
1
−
1
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'
];
}
}
...
...
This diff is collapsed.
Click to expand it.
modules/node/node.test
+
15
−
0
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment