Issue #1953444 by amateescu, xjm: Make 'target bundles' required on the Entity reference instance settings form to help increase their visibility/sanity.
parent
3a91a52862
commit
63e7c7641f
|
@ -97,7 +97,8 @@ class SelectionBase implements SelectionInterface {
|
|||
'#type' => 'checkboxes',
|
||||
'#title' => $target_bundles_title,
|
||||
'#options' => $bundle_options,
|
||||
'#default_value' => (!empty($instance['settings']['handler_settings']['target_bundles'])) ? $instance['settings']['handler_settings']['target_bundles'] : array_keys($bundle_options),
|
||||
'#default_value' => (!empty($instance['settings']['handler_settings']['target_bundles'])) ? $instance['settings']['handler_settings']['target_bundles'] : array(),
|
||||
'#required' => TRUE,
|
||||
'#size' => 6,
|
||||
'#multiple' => TRUE,
|
||||
'#element_validate' => array('_entity_reference_element_validate_filter'),
|
||||
|
|
|
@ -100,7 +100,9 @@ class EntityReferenceAdminTest extends WebTestBase {
|
|||
$this->drupalPostAJAX(NULL, array('instance[settings][handler_settings][sort][field]' => '_none'), 'instance[settings][handler_settings][sort][field]');
|
||||
|
||||
// Third step: confirm.
|
||||
$this->drupalPost(NULL, array(), t('Save settings'));
|
||||
$this->drupalPost(NULL, array(
|
||||
'instance[settings][handler_settings][target_bundles][' . key($bundles) . ']' => key($bundles),
|
||||
), t('Save settings'));
|
||||
|
||||
// Check that the field appears in the overview form.
|
||||
$this->assertFieldByXPath('//table[@id="field-overview"]//td[1]', 'Test label', t('Field was created and appears in the overview page.'));
|
||||
|
|
Loading…
Reference in New Issue