Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
drupal
Commits
f5289f54
Commit
f5289f54
authored
12 years ago
by
Daniel Wehner
Committed by
Tim Plunkett
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1798026
by damiankloip, dawehner: Fixed handler order is reset when a view is saved.
parent
38051784
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Drupal/views/Tests/Handler/HandlerTest.php
+28
-0
28 additions, 0 deletions
lib/Drupal/views/Tests/Handler/HandlerTest.php
tests/views_test_config/config/views.view.test_view_handler_weight.yml
+63
-0
63 additions, 0 deletions
...est_config/config/views.view.test_view_handler_weight.yml
with
91 additions
and
0 deletions
lib/Drupal/views/Tests/Handler/HandlerTest.php
+
28
−
0
View file @
f5289f54
...
...
@@ -173,6 +173,34 @@ function testBreakPhrase() {
$this
->
assertEqual
(
'and'
,
$handler
->
operator
);
}
/**
* Tests the order of handlers is the same before and after saving.
*/
public
function
testHandlerWeights
()
{
$handler_types
=
array
(
'fields'
,
'filters'
,
'sorts'
);
$view
=
views_get_view
(
'test_view_handler_weight'
);
$view
->
initDisplay
();
// Store the order of handlers before saving the view.
$original_order
=
array
();
foreach
(
$handler_types
as
$type
)
{
$original_order
[
$type
]
=
array_keys
(
$view
->
display_handler
->
getOption
(
$type
));
}
// Save the view and see if our filters are in the same order.
$view
->
save
();
$view
=
views_get_view
(
'test_view_handler_weight'
);
$view
->
initDisplay
();
foreach
(
$handler_types
as
$type
)
{
$loaded_order
=
array_keys
(
$view
->
display_handler
->
getOption
(
$type
));
$this
->
assertIdentical
(
$original_order
[
$type
],
$loaded_order
);
}
}
/**
* Check to see if a value is the same as the value on a certain handler.
*
...
...
This diff is collapsed.
Click to expand it.
tests/views_test_config/config/views.view.test_view_handler_weight.yml
0 → 100644
+
63
−
0
View file @
f5289f54
api_version
:
'
3.0'
base_table
:
views_test_data
core
:
'
8'
description
:
'
'
disabled
:
'
0'
display
:
default
:
display_options
:
defaults
:
fields
:
'
0'
pager
:
'
0'
pager_options
:
'
0'
sorts
:
'
0'
fields
:
id
:
field
:
id
id
:
id
relationship
:
none
table
:
views_test_data
age
:
field
:
age
id
:
age
relationship
:
none
table
:
views_test_data
name
:
field
:
name
id
:
name
relationship
:
none
table
:
views_test_data
pager
:
options
:
offset
:
'
0'
type
:
none
pager_options
:
{
}
sorts
:
id
:
field
:
id
id
:
id
order
:
ASC
relationship
:
none
table
:
views_test_data
age
:
field
:
age
id
:
standard
order
:
ASC
relationship
:
none
table
:
views_test_data
filters
:
name
:
field
:
name
id
:
string
table
:
views_test_data
age
:
field
:
age
id
:
numeric
table
:
views_test_data
display_plugin
:
default
display_title
:
Master
id
:
default
position
:
'
0'
human_name
:
'
'
name
:
test_view_handler_weight
tag
:
'
'
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