The most recent version of this plugin (I haven't yet tested with earlier versions) seems to fail to function if neither of the documentTypes or languageFilter options are set. The filter is displayed on the top of the page, but selecting items does nothing and the filterField function isn't called at all. Adding the required schema types to the documentTypes config option solves this, and the filtering functionality works again.
Filter active, with no documentTypes set, does nothing:
Enabling the documentTypes option (or setting the languageFilter on the schema in question) causes the filtering to kick in:
I'm not sure if this is an actual issue, or just a case of outdated documentation.
To Reproduce
Steps to reproduce the behavior:
Set up the plugin as described in the README. Do not set a languageFilter array in the config.
Try and filter fields - this will fail.
Set the languageFilter config option.
Filtering will work on the configured schema types.
Expected behavior
Filtering of localised fields will work on all schemas if no languageFilter is set.
Which versions of Sanity are you using?
@sanity/cli (global) 3.36.4 (up to date)
@sanity/cli 3.36.4 (up to date)
@sanity/components 2.14.0 (up to date)
@sanity/google-maps-input 3.0.2 (up to date)
@sanity/language-filter 3.2.2 (up to date)
@sanity/table 1.1.2 (up to date)
@sanity/vision 3.36.4 (up to date)
sanity 3.36.4 (up to date)
Describe the bug
The documentation seems to indicate that not setting the
documentTypes
field on the plugin configuration will show the filter on all schema types: https://github.com/sanity-io/language-filter/blob/d2ea195f00ca92b54b3ca70fc0e739de1494b17e/README.md?plain=1#L84The most recent version of this plugin (I haven't yet tested with earlier versions) seems to fail to function if neither of the
documentTypes
orlanguageFilter
options are set. The filter is displayed on the top of the page, but selecting items does nothing and thefilterField
function isn't called at all. Adding the required schema types to thedocumentTypes
config option solves this, and the filtering functionality works again.Filter active, with no![image](https://github.com/sanity-io/language-filter/assets/3172781/94dd4bb3-af53-405c-af0e-759665c2192f)
documentTypes
set, does nothing:Enabling the![image](https://github.com/sanity-io/language-filter/assets/3172781/6c932c7d-5229-4ad6-90ea-81b75dc293bc)
documentTypes
option (or setting thelanguageFilter
on the schema in question) causes the filtering to kick in:I'm not sure if this is an actual issue, or just a case of outdated documentation.
To Reproduce
Steps to reproduce the behavior:
languageFilter
array in the config.languageFilter
config option.Expected behavior
Filtering of localised fields will work on all schemas if no
languageFilter
is set.Which versions of Sanity are you using?
What operating system are you using? Windows.
Which versions of Node.js / npm are you running?