RedTurtle / redturtle.volto

Helper package to setup a RedTurtle's Plone site ready to work with Volto
GNU General Public License v2.0
1 stars 1 forks source link

Querystringsearch patch for missing absolutePath #99

Closed cekk closed 7 months ago

cekk commented 7 months ago

This patch prevents an error with objectbrowser when you have a criteria that points to a not existing UID (or no more existing). For example a listing block with a "absolutePath" criteria that points to a deleted folder.

Plone by default, in querystring, perform a catalog search through all site (/Plone) if given UID is not valid. This is bad in objectbrowser because it made a @querystring-search call with b_size=1 to get the referenced object. The original call, get all the site contents and returns the first one..that is not the item that we want to save inside the block.

This patch do not do any catalog search if absolutePath is invalid, and return a 400.

coveralls commented 7 months ago

Pull Request Test Coverage Report for Build 8328629411

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/redturtle/volto/restapi/services/querystringsearch/get.py 16 20 80.0%
<!-- Total: 16 20 80.0% -->
Totals Coverage Status
Change from base Build 8231419485: 0.3%
Covered Lines: 881
Relevant Lines: 1371

💛 - Coveralls