Commit f66616bf authored by Dries's avatar Dries
Browse files

Issue #2356297 by olli, alexpott: Fixed Double escaping in views ui grouped filters.

parent b7ad99ad
......@@ -52,6 +52,15 @@ public function testFilterBooleanUI() {
$this->assertEqual((int) $result[2]->attributes()->checked, 'checked');
$result = $this->xpath('//input[@name="options[group_info][group_items][3][value]"]');
$this->assertEqual((int) $result[1]->attributes()->checked, 'checked');
// Test selecting a default and removing an item.
$edit = array();
$edit['options[group_info][default_group]'] = 2;
$edit['options[group_info][group_items][3][remove]'] = 1;
$this->drupalPostForm(NULL, $edit, t('Apply'));
$this->drupalGet('admin/structure/views/nojs/handler/test_view/default/filter/status');
$this->assertFieldByName('options[group_info][default_group]', 2, 'Second item was set as the default.');
$this->assertNoField('options[group_info][group_items][3][remove]', 'Third item was removed.');
}
}
......@@ -147,12 +147,20 @@ function theme_views_ui_build_group_filter_form($variables) {
foreach (Element::children($form['group_items']) as $group_id) {
$form['group_items'][$group_id]['value']['#title'] = '';
$data = array(
'default' => drupal_render($form['default_group'][$group_id]) . drupal_render($form['default_group_multiple'][$group_id]),
'default' => array(
'data' => array(
'#markup' => drupal_render($form['default_group'][$group_id]) . drupal_render($form['default_group_multiple'][$group_id]),
),
),
'weight' => drupal_render($form['group_items'][$group_id]['weight']),
'title' => drupal_render($form['group_items'][$group_id]['title']),
'operator' => drupal_render($form['group_items'][$group_id]['operator']),
'value' => drupal_render($form['group_items'][$group_id]['value']),
'remove' => drupal_render($form['group_items'][$group_id]['remove']) . _l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $group_id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true)),
'remove' => array(
'data' => array(
'#markup' => drupal_render($form['group_items'][$group_id]['remove']) . _l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $group_id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true)),
),
),
);
$rows[] = array('data' => $data, 'id' => 'views-row-' . $group_id, 'class' => array('draggable'));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment