volto
volto copied to clipboard
Search block ignores depth setting
Describe the bug
Field "depth" is ignored when configuring the base search query in a search block.
To Reproduce
- Create new search block
- In base search query set absolute / relative path
- In base search query set depth to 1
- Results will not be restricted to this depth level
Expected behavior
If path and depth is set, results should only be within specified depth.
Screenshots
(page "Level 3" should not be part of the result set)
Software (please complete the following information):
- OS: Ubuntu
- Browser: Firefox
- Volto Version 17.15.4
- Plone Version 6.0.9
- Plone REST API Version 9.2.1
Possible fix
In /components/manage/Blocks/Search/hocs/withSearch.jsx include depth into the result of getInitialState, for example by adding following line: depth: data.query?.depth