volto icon indicating copy to clipboard operation
volto copied to clipboard

Search block ignores depth setting

Open mbarde opened this issue 1 year ago • 0 comments

Describe the bug

Field "depth" is ignored when configuring the base search query in a search block.

To Reproduce

  1. Create new search block
  2. In base search query set absolute / relative path
  3. In base search query set depth to 1
  4. 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

Screenshot_2024-03-07_15-37-05 Screenshot_2024-03-07_15-37-25

(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

mbarde avatar Mar 07 '24 14:03 mbarde