You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling the API endpoint for a single entry or term, an exception is thrown and no result is returned.
Error message:
Object of class Statamic\Entries\Entry could not be converted to string
After an in-depth analysis, I found the following:
Resource controllers are used, which already give the complete collection as a parameter in the controller. However, it is assumed in the controller that an ID comes in and then a ::find() query is made on the facade.
This leads to an object to string collision.
Translated with DeepL.com (free version)
How to reproduce
Activate the API for a collection and call the API endpoint for an entry with the ID.
christophstockinger
changed the title
Can't query a single entry or term on URI (REST-APO)
Can't query a single entry or term on URI (REST-API)
Sep 26, 2024
Bug description
When calling the API endpoint for a single entry or term, an exception is thrown and no result is returned.
Error message:
After an in-depth analysis, I found the following:
Resource controllers are used, which already give the complete collection as a parameter in the controller. However, it is assumed in the controller that an ID comes in and then a
::find()
query is made on the facade.This leads to an object to string collision.
Translated with DeepL.com (free version)
How to reproduce
Activate the API for a collection and call the API endpoint for an entry with the ID.
Logs
No response
Environment
Installation
Existing Laravel app
Additional details
I create a PR that fixes the problem.
The text was updated successfully, but these errors were encountered: