plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
428 stars 573 forks source link

Search block ignores depth setting #5856

Open mbarde opened 2 months ago

mbarde commented 2 months ago

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):

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