Loading config/schema/search_api_spellcheck.schema.yml 0 → 100644 +24 −0 Original line number Diff line number Diff line views.area.search_api_spellcheck_did_you_mean: type: views_area label: 'Did you mean' mapping: search_api_spellcheck_count: type: integer label: 'Specifies the maximum number of suggestion.' search_api_spellcheck_hide_on_result: type: boolean label: 'Hide when the view has results.' search_api_spellcheck_collate: type: boolean label: 'The amount of results to show.' views.area.search_api_spellcheck_suggestions: type: views_area label: 'Suggestions' mapping: search_api_spellcheck_count: type: integer label: 'Specifies the maximum number of suggestion.' search_api_spellcheck_collate: type: boolean label: 'The amount of results to show.' src/Plugin/views/area/DidYouMeanSpellCheck.php +9 −0 Original line number Diff line number Diff line Loading @@ -199,4 +199,13 @@ class DidYouMeanSpellCheck extends AreaPluginBase { return Link::fromTextAndUrl($new_keys, $url); } /** * {@inheritdoc} */ public function validateOptionsForm(&$form, FormStateInterface $form_state): void { // Cast to boolean to honour the plugin config schema. $path = ['options', 'search_api_spellcheck_hide_on_result']; $form_state->setValue($path, (bool) $form_state->getValue($path)); parent::validateOptionsForm($form, $form_state); } } Loading
config/schema/search_api_spellcheck.schema.yml 0 → 100644 +24 −0 Original line number Diff line number Diff line views.area.search_api_spellcheck_did_you_mean: type: views_area label: 'Did you mean' mapping: search_api_spellcheck_count: type: integer label: 'Specifies the maximum number of suggestion.' search_api_spellcheck_hide_on_result: type: boolean label: 'Hide when the view has results.' search_api_spellcheck_collate: type: boolean label: 'The amount of results to show.' views.area.search_api_spellcheck_suggestions: type: views_area label: 'Suggestions' mapping: search_api_spellcheck_count: type: integer label: 'Specifies the maximum number of suggestion.' search_api_spellcheck_collate: type: boolean label: 'The amount of results to show.'
src/Plugin/views/area/DidYouMeanSpellCheck.php +9 −0 Original line number Diff line number Diff line Loading @@ -199,4 +199,13 @@ class DidYouMeanSpellCheck extends AreaPluginBase { return Link::fromTextAndUrl($new_keys, $url); } /** * {@inheritdoc} */ public function validateOptionsForm(&$form, FormStateInterface $form_state): void { // Cast to boolean to honour the plugin config schema. $path = ['options', 'search_api_spellcheck_hide_on_result']; $form_state->setValue($path, (bool) $form_state->getValue($path)); parent::validateOptionsForm($form, $form_state); } }