Jump to content

Recommended Posts

Posted

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?

 

Posted (edited)

I checked the source code, based on the 400 response code I understand that this is the relevant code from CommentController:

Could contain: Text, Blackboard

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 by Omri Amos
Posted

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.

 

  • 2 weeks later...
Posted
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?

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...