Problem/Motivation
The module does not have a configuration schema file at all. If
the configuration inspector module →
is installed for development, it will show the errors.
Steps to reproduce
Install configuration inspector for easy detection. Check the errors from the main Status Report page.
Proposed resolution
Add a schema file at config/schema/search_api_block.schema.yml, with content like this:
block.settings.search_api_form_block:
type: block_settings
label: "Search API Block settings"
mapping:
action_url:
type: path
label: "The search page that the form submits to (e.g. /search). This input supports token values."
input_name:
type: label
label: "The name of the search input. This should be the name of the exposed filter."
input_placeholder:
type: label
label: "The placeholder of the search input."
submit_value:
type: label
label: "The value of the submit button."
pass_get_params:
type: boolean
label: "If this box is checked, any GET parameter added to the Search page URL will be passed as a hidden parameter."
input_label:
type: label
label: "The label of the search input."
input_label_visibility:
type: label
label: "The visibility of the label."
I copied the labels from the help text on the form, so there may be room to improve that, but the core technical requirement of declaring the keys I think is good.
Remaining tasks
pass_get_params was previously being stored, at least in my config, as 0 instead of FALSE. Nothing broke when I applied the schema above, but it continued to show an error for that line in config inspector, until I manually changed in my config from 0 to FALSE. There may be something else that can be done there to programmatically convert that, but it was not a big enough problem that I really felt I needed to spend long on it. Some other modules I use had a similar switch from 0/1 to True/False and didn't provide any update path, so I think it's probably fine as is.