Skip to content
Snippets Groups Projects
Commit f5289f54 authored by Daniel Wehner's avatar Daniel Wehner Committed by Tim Plunkett
Browse files

Issue #1798026 by damiankloip, dawehner: Fixed handler order is reset when a view is saved.

parent 38051784
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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.
*
......
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: ''
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment