plone / plone.restapi

RESTful API for Plone.
http://plonerestapi.readthedocs.org/
84 stars 75 forks source link

Skip next/previous info for old versions if it can't be obtained #1651

Closed davisagli closed 1 year ago

davisagli commented 1 year ago

Fixes #1650

If the item was renamed or moved, then its id might not be found in the current object's container. In that case let's degrade gracefully and leave out the previous_item and next_item rather than raising a ValueError.

mister-roboto commented 1 year ago

@davisagli thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

netlify[bot] commented 1 year ago

Deploy Preview for plone-restapi canceled.

Name Link
Latest commit c59999e32d11854625d9f191088bbfd8f312a70b
Latest deploy log https://app.netlify.com/sites/plone-restapi/deploys/6478bd1fd9244c00088926cc
davisagli commented 1 year ago

@jenkins-plone-org please run jobs

sneridagh commented 1 year ago

@tisto could you please take a look, merge and release? Thx!

davisagli commented 1 year ago

@tisto I updated it to return {previous_item: {}, next_item: {}} to match the format that is used when there is no previous item or next item (i.e. first/last item in container).