Commit 4493d029 authored by alexpott's avatar alexpott

Issue #2370005 by olli: Fixed Remove link in views ui grouped filter and...

Issue #2370005 by olli: Fixed Remove link in views ui grouped filter and rearrange fields/sorts does not work.
parent 789de472
......@@ -125,7 +125,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#id' => 'views-removed-' . $id,
'#attributes' => array('class' => array('views-remove-checkbox')),
'#default_value' => 0,
'#suffix' => \Drupal::l('<span>' . $this->t('Remove') . '</span>', Url::fromRoute('<none>', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-remove-link'), 'alt' => $this->t('Remove this item'), 'title' => $this->t('Remove this item')), 'html' => TRUE))),
'#suffix' => \Drupal::l('<span>' . $this->t('Remove') . '</span>', Url::fromRoute('<none>', [], array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-remove-link'), 'alt' => $this->t('Remove this item'), 'title' => $this->t('Remove this item')), 'html' => TRUE))),
);
}
......
......@@ -53,6 +53,9 @@ public function testFilterBooleanUI() {
$result = $this->xpath('//input[@name="options[group_info][group_items][3][value]"]');
$this->assertEqual((int) $result[1]->attributes()->checked, 'checked');
// Test that there is a remove link for each group.
$this->assertEqual(count($this->cssSelect('a.views-remove-link')), 3);
// Test selecting a default and removing an item.
$edit = array();
$edit['options[group_info][default_group]'] = 2;
......
......@@ -75,6 +75,9 @@ public function testRearrangeFields() {
}
$this->drupalPostForm('admin/structure/views/nojs/rearrange/' . $view_name . '/default/field', $fields, t('Apply'));
$this->assertFieldOrder($view_name, $reversedFields);
// Checks that there is a remove link for each field.
$this->assertEqual(count($this->cssSelect('a.views-remove-link')), count($fields));
}
}
......@@ -158,7 +158,7 @@ function theme_views_ui_build_group_filter_form($variables) {
'value' => drupal_render($form['group_items'][$group_id]['value']),
'remove' => array(
'data' => array(
'#markup' => drupal_render($form['group_items'][$group_id]['remove']) . \Drupal::l('<span>' . t('Remove') . '</span>', Url::fromRoute('<none>', 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))),
'#markup' => drupal_render($form['group_items'][$group_id]['remove']) . \Drupal::l('<span>' . t('Remove') . '</span>', Url::fromRoute('<none>', [], 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))),
),
),
);
......
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