Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querystringsearch patch for missing absolutePath #99

Merged
merged 5 commits into from
Mar 19, 2024

Conversation

cekk
Copy link
Member

@cekk cekk commented Mar 18, 2024

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.

cekk added 3 commits March 18, 2024 12:46
…e if there is an absolutePath criteria with non existing UID and b_size==1
…e if there is an absolutePath criteria with non existing UID and b_size==1
…e if there is an absolutePath criteria with non existing UID and b_size==1
@cekk cekk requested review from mamico and luca-bellenghi March 18, 2024 11:55
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8328629411

Details

  • 16 of 20 (80.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 64.26%

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

💛 - Coveralls

@luca-bellenghi luca-bellenghi merged commit 9c97b44 into master Mar 19, 2024
18 checks passed
@luca-bellenghi luca-bellenghi deleted the querystringsearch_patch branch March 19, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants