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.
Comments
Comment #2
ryan-l-robinson commentedAh, good news, it looks like this is already in progress and it just hasn't made it into a release yet! https://git.drupalcode.org/project/search_api_block/-/blob/1.0.x/config/...
I did the git clone to start to prepare an MR and found a file already there. It is named simply schema.yml instead of search_api_block.schema.yml, the latter of which seems to be the standard practice. Otherwise, please put this into a release once you're confident it's ready.
I attempted to make a patch to use until that release, but could not seem to get it to work, so I'll have to put up with the errors until the release.
Comment #3
ryan-l-robinson commentedIs it possible to get this into a release? It's one of my last remaining config schema errors.
Comment #4
ryan-l-robinson commentedComment #5
phjou@ryanrobinson_wlu I'll check that if we just need to rename the file
Comment #6
phjouComment #7
phjou@ryanrobinson_wlu Fixed.
You can upgrade to 1.1.7 in order to get the change but I would recommend to upgrade to 1.2.0.
I also dropped support for Drupal 8 & 9 that are not supported anymore on 1.2.0.
Thanks for your help!