Skip to content
Snippets Groups Projects

refs #3040533: Set default value for Any text field

Open loon requested to merge issue/custom_search-3040533:3040533-only-require-input into 8.x-1.x
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -183,7 +183,7 @@ class CustomSearchBlock extends BlockBase implements ContainerFactoryPluginInter
$defaults['taxonomy'][$vocId]['depth'] = 0;
$defaults['taxonomy'][$vocId]['label_visibility'] = TRUE;
$defaults['taxonomy'][$vocId]['label'] = $voc->label();
$defaults['taxonomy'][$vocId]['all_text'] = t('- Any -');
$defaults['taxonomy'][$vocId]['all_text'] = $this->t('- Any -');
$defaults['taxonomy'][$vocId]['region'] = 'block';
$defaults['taxonomy'][$vocId]['weight'] = $vocWeight;
$vocWeight++;
@@ -459,7 +459,7 @@ class CustomSearchBlock extends BlockBase implements ContainerFactoryPluginInter
$form['taxonomy'][$vocId]['all_text'] = [
'#type' => 'textfield',
'#title' => $this->t('-Any- text'),
'#default_value' => $this->configuration['taxonomy'][$vocId]['all_text'],
'#default_value' => $this->configuration['taxonomy'][$vocId]['all_text'] ?? $this->t('- Any -'),
'#required' => TRUE,
'#description' => $this->t('Enter the text for "any term" choice. The default value is "- Any -".'),
];
Loading