Omri Amos Posted October 4 Posted October 4 According to the docs, sending out author param as 0 means post as guest (with author_name as his name) However when I try to post a comment as guest, I get "errorCode": "1F295/2", "errorMessage": "NO_AUTHOR". If I try to use an ID of an actual existing user instead of 0 - it's working fine. I am 99% sure this worked in the past (a few years ago) so maybe something changed? Just to make sure this is not a permissions issue I verified that the forum I'm trying to post to have commenting permissions for guests (even though I don't think it needs to have it in order to post via the API). Am I missing something?
Omri Amos Posted October 4 Author Posted October 4 (edited) I checked the source code, based on the 400 response code I understand that this is the relevant code from CommentController: I debugged the code and found out that \IPS\Request::i()->author was indeed 0, but as a string (as always with POST fields). And since you are using === to check explicitly against an int, it failed. I manually changed it to if ( intval(\IPS\Request::i()->author) === 0 ) and now it's working fine. But manually changing core files is obviously not something I should do, so please fix this in the official code (both V4 and V5?)... Thanks Edited October 4 by Omri Amos Afrodude 1
Daniel F Posted October 4 Posted October 4 Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.
Omri Amos Posted October 18 Author Posted October 18 On 10/4/2024 at 3:03 PM, Daniel F said: Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release. Can you please confirm that/if it is fixed on IPS v5 beta?
Daniel F Posted October 18 Posted October 18 38 minutes ago, Omri Amos said: Can you please confirm that/if it is fixed on IPS v5 beta? This will be fixed in the next beta!
Recommended Posts