Error when trying t...
 
Notifications
Clear all

Error when trying to block a user: "An error occurred"

4 Posts
2 Users
0 Reactions
697 Views
(@tommih)
Posts: 44
Trusted Member
Topic starter
 

Hello,

We've added a "Block" button to our message display. When you press it, the sender of the selected message is blocked. I do this with this code:

public void BlockSelectedPlayer(){
        CombuManager.localUser.AddContact(selectedMessage.fromUser.userNameeContactType.Ignore, (successerror) => {
            if (success){
            } else {
                Debug.LogError("Message block error: " error);
            }
        });
    }

This seems to sometimes work as expected, but a lot of the time we just get the error message "An error occurred". Any idea what would cause that error?

Thanks in advance for any response!

 
Posted : 19/02/2016 6:11 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

mmh.. sounds strange, may be there's some special situations that causes this issue. You could debug this by activating the checkbox Debug Log in inspector to copy from console log the URL with params that is getting called by AddContact and put it on web browser when it returns error, then you can debug the script /contacts.php in the function wsSave() you could add some echo to see where it's going and eventually catch what's the happening (the string "An error occurred" is set at line 176, so likely $rec is resulting null because looks strange that there's an error in CB_Friend::Save).

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 19/02/2016 7:14 pm
(@tommih)
Posts: 44
Trusted Member
Topic starter
 

Thanks!

Our server dev checked this out and this is what he said:

"Tracking down the URL of the request, here is what I found: The if statement on line 128 of contacts.php is triggered, which appears to add the user block into the database. After this process, execution skips to line 174, but at this point the variable $rec has not been set, so the error condition is triggered. If I am following the logic, correctly, this is a bug, but you may want to run this past the Combu dev."

I'd appreciate any comment on this.

 
Posted : 22/02/2016 3:47 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Checked back, I missed the assignment of $success, it's definitely a bug and will be fixed in the next release.

Here's the solution at line 133 of contacts.php you must have:

$success = $other->Save();

Thanks for the report.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 22/02/2016 5:34 pm
Share: