Closed linusschwab closed 2 years ago
We have the same issue. Rolling back to 2.8.0 resolved it. 2.8.1 is definitely where it was introduced
We have the same issue too.
Just pushed up a fix for this if someone wants to confirm it on their setups. https://github.com/craftcms/element-api/commit/14f465f7522bb553c57792722891386d2a6ce346
Thanks for the fix! With the second commit a655295 everything works again.
Just tagged 2.8.4 with this fix.
Description
After updating to the newest version of Element API, the endpoints now always throw a 500 instead of a 404 error if the element query returns no results.
I think this was introduced in version 2.8.1 according to the releasenotes: "Fixed a bug where most exceptions were resulting in 404 responses rather than 500s".
Is this change intentional like that and expected behaviour? If so, what needs to be changed for it to throw 404 errors again if an element is not found? As a workaround, we temporary downgraded to version 2.7.0, where this works as expected.
Let me know if you need any additional information.
Steps to reproduce
Element API config
The defaults are set like that:
Additional info