Commit 5e557e6e authored by webchick's avatar webchick
Browse files

Issue #2513612 by davidhernandez, ivanstegic, Bojhan, eliza411, LewisNyman,...

Issue #2513612 by davidhernandez, ivanstegic, Bojhan, eliza411, LewisNyman, lunk_rat, nickrosencrans, stpaultim, webchick: Make the autocomplete form option text for an entity reference not be all caps
parent cc8e7c3f
......@@ -46,10 +46,7 @@ public function settingsForm(array $form, FormStateInterface $form_state) {
'#type' => 'radios',
'#title' => t('Autocomplete matching'),
'#default_value' => $this->getSetting('match_operator'),
'#options' => array(
'STARTS_WITH' => t('Starts with'),
'CONTAINS' => t('Contains'),
),
'#options' => $this->getMatchOperatorOptions(),
'#description' => t('Select the method used to collect autocomplete suggestions. Note that <em>Contains</em> can cause performance issues on sites with thousands of entities.'),
);
$element['size'] = array(
......@@ -74,7 +71,8 @@ public function settingsForm(array $form, FormStateInterface $form_state) {
public function settingsSummary() {
$summary = array();
$summary[] = t('Autocomplete matching: @match_operator', array('@match_operator' => $this->getSetting('match_operator')));
$operators = $this->getMatchOperatorOptions();
$summary[] = t('Autocomplete matching: @match_operator', array('@match_operator' => $operators[$this->getSetting('match_operator')]));
$summary[] = t('Textfield size: !size', array('!size' => $this->getSetting('size')));
$placeholder = $this->getSetting('placeholder');
if (!empty($placeholder)) {
......@@ -181,4 +179,17 @@ protected function getSelectionHandlerSetting($setting_name) {
return isset($settings[$setting_name]) ? $settings[$setting_name] : NULL;
}
/**
* Returns the options for the match operator.
*
* @return array
* List of options.
*/
protected function getMatchOperatorOptions() {
return [
'STARTS_WITH' => t('Starts with'),
'CONTAINS' => t('Contains'),
];
}
}
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