Issue #2337897 by damiankloip: Fixed ManyToOne filter should not display ManyToOneHelper valueForm when exposed.
parent
f070288cce
commit
22c1362cb4
|
@ -55,6 +55,14 @@ class UserAdminTest extends WebTestBase {
|
||||||
$link = l(t('Edit'), "user/" . $user_a->id() . "/edit", array('query' => array('destination' => 'admin/people')));
|
$link = l(t('Edit'), "user/" . $user_a->id() . "/edit", array('query' => array('destination' => 'admin/people')));
|
||||||
$this->assertRaw($link, 'Found user A edit link on admin users page');
|
$this->assertRaw($link, 'Found user A edit link on admin users page');
|
||||||
|
|
||||||
|
// Test exposed filter elements.
|
||||||
|
foreach (array('user', 'role', 'permission', 'status') as $field) {
|
||||||
|
$this->assertField("edit-$field", "$field exposed filter found.");
|
||||||
|
}
|
||||||
|
// Make sure the reduce duplicates element from the ManyToOneHelper is not
|
||||||
|
// displayed.
|
||||||
|
$this->assertNoField('edit-reduce-duplicates', 'Reduce duplicates form element not found in exposed filters.');
|
||||||
|
|
||||||
// Filter the users by name/email.
|
// Filter the users by name/email.
|
||||||
$this->drupalGet('admin/people', array('query' => array('user' => $user_a->getUsername())));
|
$this->drupalGet('admin/people', array('query' => array('user' => $user_a->getUsername())));
|
||||||
$result = $this->xpath('//table/tbody/tr');
|
$result = $this->xpath('//table/tbody/tr');
|
||||||
|
|
|
@ -111,7 +111,7 @@ class ManyToOne extends InOperator {
|
||||||
protected function valueForm(&$form, FormStateInterface $form_state) {
|
protected function valueForm(&$form, FormStateInterface $form_state) {
|
||||||
parent::valueForm($form, $form_state);
|
parent::valueForm($form, $form_state);
|
||||||
|
|
||||||
if ($form_state->get('exposed')) {
|
if (!$form_state->get('exposed')) {
|
||||||
$this->helper->buildOptionsForm($form, $form_state);
|
$this->helper->buildOptionsForm($form, $form_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue