Private Message Problem

Permalink
I have an issue with private messages not showing. I am using version 5.6.3.4.

users can send a message to another, and that user can see that there is a message within the /profile/messages/ page under inbox. But when the user clicks on inbox it says 'No messages found.'.

There are entries in the UserPrivateMessages and UserPrivateMessageTo tables.

This issue is happening across multiple sites. I have verified that it is not a theme issue, as it does it with the default theme. I have disabled all addons and the issues still persists.

What am I doing wrong? Am at my wits end. If anyone could please help that would be greatly appretiated.

 
enlil replied on at Permalink Reply
enlil
Good to know we're narrowing down this issue(that it's 5.6.3.4 related and I'm not crazy). I posted recently on the issue as well.

http://www.concrete5.org/community/forums/customizing_c5/messaging-...

EDIT: I'd have to double check my database, but what seems to be happening in one of the tables is the message id is being saved as 0 AND the id it *should* be saved as throwing the error. Haven't investigated further.
enlil replied on at Permalink Reply 1 Attachment
enlil
Attached is a screenshot of my UserPrivateMessagesTo table showing the bad entries
Remo replied on at Permalink Best Answer Reply
Remo
I think that problem is fairly simple. The code was bogus before, but as enlil mentioned, it only causes a problem with mysqli.

This should fix the problemhttps://github.com/concrete5/concrete5-legacy/pull/1937...

I'm not quite sure how to fix the already existing IDs which have been added to the table in a wrong way. You might have to fix those manually. I could imagine that if you'd just go through the table in the physical order you could increment the IDs where necessary.
enlil replied on at Permalink Reply
enlil
I just tested the pull request and although I'm now not getting the mysqli error, there are still msgID's being saved as 0 in the userPrivateMessagesTo table and the messages are not showing up in the mailbox. Removing the msgID 0 entries and/or completely flushing both userPrivateMessages tables does no good.
Remo replied on at Permalink Reply
Remo
It's pretty hard to imagine how a value of 0 can still get there, check this line, the code is as simple as it gets:
https://github.com/concrete5/concrete5-legacy/pull/1937/files#diff-4...

Can you please add a break point there and see what you get? I works for me and with such a simple code I really can't imagine what could go wrong..
enlil replied on at Permalink Reply
enlil
I tried again, first emptying the message tables and I'm getting the same results. I've doublechecked the code in the pull etc. Leading me to believe the issue lies somewhere within the $db->Insert_ID() call ?
Remo replied on at Permalink Reply
Remo
That makes no sense at all. If it would return 0 we would't get into the condition at all.
Can you please add a breakpoint there and see where the codes goes through?
enlil replied on at Permalink Reply
enlil
So it probably helps to be updating the code in the proper place. I was playing with the installed core and not within the updates folder. The fix works! https://github.com/concrete5/concrete5-legacy/pull/1937/commits/d93a...

@Remo In regards to "fix undefined variable", I'm seeing an unsupported operand type error when i try to implement that. Messaging now works fine without that update. May want to take a second look before merge.

Thanks Remo!
Remo replied on at Permalink Reply
Remo
Can you please post the exact error message? I'm again not able to reproduce your problem. All I did is introduce a variable because later when the mail was sent we were using it, but it wasn't defined.. I could have remove it completely as this variable isn't used in the core, but I thought I'd rather fix it and not change its behaviour.
Thanks
Remo replied on at Permalink Reply
Remo
Can you please post the exact error message? I'd like to merge this pull request. Thanks!