Closed sneridagh closed 4 years ago
@rodfersou please take a look if you can fix it quickly.
@sneridagh it just works here:
$ http http://localhost:8080/Plone/news/events Accept:application/json -a admin:admin | jq '.previous_item'
{
"@id": "http://localhost:8080/Plone/news",
"@type": "Folder",
"description": "Site News",
"title": "News"
}
...src/kitconcept/contentcreator master ✔
$ http http://localhost:8080/Plone/news/events Accept:application/json -a admin:admin | jq '.next_item'
{
"@id": "http://localhost:8080/Plone/Members",
"@type": "Folder",
"description": "Site Users",
"title": "Users"
}
okay, now I see the problem:
$ http http://localhost:8080/Plone/events/aggregator Accept:application/json -a admin:admin
HTTP/1.1 500 Internal Server Error
Connection: close
Content-Length: 110
Content-Type: text/plain
Date: Tue, 28 Apr 2020 08:27:03 GMT
Server: waitress
Internal Server Error
The server encountered an unexpected internal server error
(generated by waitress)
@sneridagh turns out that the problem is that the folder is set as unordered
, and it is returning None
when try to get the object position: https://github.com/plone/plone.app.contenttypes/blob/master/plone/app/contenttypes/setuphandlers.py#L225
we can treat the exception and don't show next/previous in this case.. although the right thing should be to fix the initial content creation at p.a.contenttypes
.
@rodfersou that is an use case we have to catch in p.restapi.
Access to a collection (spotted in news/events Plone site default items), The API throws an 500: