Merge pull request #28 from amym-li/edismax-settings

EDismax option cannot be unchecked on settings form
This commit is contained in:
Kyle Huynh 2023-03-14 17:06:17 -04:00 committed by GitHub
commit 6b75e99407
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,6 +75,8 @@ class SettingsForm extends ConfigFormBase {
'#markup' => $this->t("Advanced Search Blocks are available in the Blocks interface for each Search API view. When placing an Advanced Search Block, you can configure the fields that are used for field-based search and whether a “recursive” search is available. The following settings apply to all Advanced Search blocks."),
'#weight' => -2,
];
$isEDismax = \Drupal::config(SettingsForm::CONFIG_NAME)->get(self::EDISMAX_SEARCH_FLAG);
$form['eDisMax'][self::EDISMAX_SEARCH_FLAG] = [
'#type' => 'checkbox',
'#title' => $this
@ -89,7 +91,7 @@ class SettingsForm extends ConfigFormBase {
</ul>
</li>
</ul>'),
'#default_value' => self::getConfig(self::EDISMAX_SEARCH_FLAG, 1),
'#default_value' => isset($isEDismax) ? $isEDismax : 1,
];
$form['eDisMax']['textfields_container'] = [