Support Forum

PM plugin problems after the last update to Version 2.3.1

BS BSABantam
BSABantam
Member

After the last round of updates to the Forum and Plugins the PM system stopped working. I checked on here and found the advise to update the permalink, which I did and the PM system started working again.

After a while I realised that there was still a problem in that messages were not displayed chronologically, but only for threads that extended to more than one page. This behaviour disappeared if the number of messages to a page was increased to more than the total messages in that thread but returned when set back to the original messages per page number. As it didn’t seem to impact on many users I left it.

Problems have now escalated and we are now getting reports of lost messages and threads.

As administrator, I sometimes receive the message ‘Illegal Database Query’, usually when looking at a users profile and sometimes using the PM system (I haven’t had any other reports of this) and there are errors in the log indicating that a database table doesn’t exist (file attached), there are also other errors and warnings in the log.

In all other respects the Forum appears to be functioning normally.

Could someone take a look and advise please?

49 Answers

New Answer

MP Mr Papa
Mr Papa
Member

just for reference, we have no reported issues with the pm system currently…

however, given the errors in your log, not sure how it was working on previous version…  critical long long ago changed stuff is just missing…

error: Table ‘********_newsite.wp_sfadversaries’ doesn’t exist

among others…

you are on SP 5.7.2 now?  what version did you upgrade from?  same question for PM…

can you check your db?  is the wp_sfadversaries table really missing?? 

BS BSABantam
BSABantam
Member

Sorry for the late reply. Yes, according to Toolbox/Environment, we are on SP 5.7.2 and PM 2.3.1. I don’t know what the previous versions were but we regularly update as they are released so they would have been the immediately preceding versions.

I checked the Database against an earlier version and indeed we are actually missing 3 SF tables

wp_sfadminkeywords

wp_sfadmintasks

wp_sfadversaries

is it OK to just add the tables from earlier?

YS Yellow Swordfish
Yellow Swordfish
Member

Yes. If you can copy the data across that would be even better. Any idea how these got removed if you have an earlier version to check against?

MP Mr Papa
Mr Papa
Member

Are you saying the tables existed before the upgrade???  That would be most odd – we don’t remove them as part of upgrade. 

You can try restoring but still worries about version they are from.  But worth a try. 

YS Yellow Swordfish
Yellow Swordfish
Member

@mr-papa – I don’t believe the structure has changed at all so it should be fine.

BS BSABantam
BSABantam
Member

I’m not sure when or how they disappeared, it’s just that I have a backup from a couple of weeks before the updates and comparing that with what we have now confirms they are missing. I’m not suggesting it was the updates that removed them, I was just trying to give you all the relevant information!

I’ll get them restored and see what happens.

MP Mr Papa
Mr Papa
Member

sorry, wasnt trying to imply anything either…  but definite head scratcher of how they would go missing…

@yellow-swordfish was only concerned on age of upgrade since we did do table upgrades several versions ago… and maybe something went south then… but concur, if only one version back, restoring should be fine…

Please do let us know how it goes…

BS BSABantam
BSABantam
Member

Well it’s been over 24 Hours since the tables were replaced and (fingers crossed) no Errors.

A couple of warnings and some notices, log attached. Anything we should be addressing?

Existing PM’s running to multiple pages are still not sorted chronologically but then they are pre-existing, what will happen with new messages under those circumstances we have yet to find out.

YS Yellow Swordfish
Yellow Swordfish
Member

I don’t think there is anything to worry about in the notices list. The main one in there is a big nuisance and is fixed in the next update – but it has no negative effect now anyway.

I would clear it out however.

I am more curious about this sorting issue. I can not replicate any peculiarities with sorting on my test systems no matter what the messages per page is set to. They are always sorted by their message ID.

Can you (1) go to the forum admin private messages options panel, ensure things are set as you wish and then perform an update (even of you change nothing).

Then go to your own SP profile (on the public side of the site) – Options – Display Options and ensure you have the PM sorting option as you want it.

Then – ensure the SP error log is empty and go to PMs and open a thread that is not sorting properly. Check it and then look at the error log. You could send it again if you like.

BS BSABantam
BSABantam
Member

I did everything as you said, the thread is still not sorted chronologically, there are 34 messages in the thread in fact the last message appears at the top of the 4th page instead of the 1st page where I would expect it to be and the first message appears at the bottom of the 2nd page instead of the last page.

There is now nothing in the Error Log.

There was a notice in the log after I updated the PM options before emptying the log and before checking the PM settings and thread.

December 8, 2016 3:51 pm | spaErrNotice | 6 | phpfile: a*****/public_html/wp-content/sp-resources/forum-plugins/private-messaging/library/sp-pm-components.php
line: 296
function: sp_pm_do_breadcrumb
Notice | Undefined variable: url

I went further and changed the PM display options to show 40 messages per page and then checked, all the messages appear in the correct order, I changed it back to 10 and the thread reverts to incorrect order.

The error log is still empty.

YS Yellow Swordfish
Yellow Swordfish
Member

Sorry for the delayed reply.

I am struggling to find any way that the sort can not be correct to be honest. My only thought is – if this is an old PM thread – i.e., prior to the last PM update that corresponded to 5.7.2 of the core SP plugin – then we know we had one or two odd anomalies which is what prompted the rewrite of much of the database query and construction code. Could it be an artifact of originally not quite right data. Although I am afraid I fail to understand the paging oddity.

If it IS an old thread, can you see what happens on completely newly created ones?

@mr-papa – any ideas? especially around the odd paging question…

BS BSABantam
BSABantam
Member

It is a thread that existed before the updates, as per the first post.

I can test with a new thread but it will be a while as it will probably need to extend to more than one page.

I thought the problem fairly limited as there were no comments from users but once one person posted others have now posted that they are having problems, see attachment.

In view of this I was wondering if it was worth deleting the PM plugin files and re-installing, but what would happen to existing messages? If they remain in the Database then I suppose the problem could re-appear as the error may be in the Database.

BS BSABantam
BSABantam
Member

Actually, thinking about it this didn’t happen at the latest update (to address Smiley support) but the previous update, after or at the SP 5.7.2 update?

I’ve been doing some testing. Firstly I found that trying to delete an entire thread with the thread open the message says deleted but when the page refreshes to the PM list, the thread is still there. using the delete button from the PM list works OK.

I’ve also realised that the PM list itself is not sorted with the latest thread at the top, it seems to be sorted by thread creation time, this wouldn’t be a problem but for the fact there is nothing to indicate which thread contains a new message apart from the date/time, I suspect this, along with the seemingly random sorting of long threads is what leads people to say they are notified of a new messages but can’t find them. The situation is compounded if the first participant deletes an entire thread but the second doesn’t. The second participant seems to be able see all or most messages in that thread and if he replies to one of these messages (deleted by the first participant), the first participant is notified of a new message but it appears way down his list, sorted by creation date of the original entire thread with the original title when he is expecting a new thread at the top!

Back to my experiment, I started by sending silly messages backwards and forwards between two accounts, this was OK up until the message count went above the page setting number (ours is set to 10), the 11th message then appeared at the top of the second page instead of the first and continued like that for a few messages but then reverted to the first page, by the time there were three pages some new messages were on the third page and it became increasingly difficult to find the latest message so I had the idea of starting another thread and just sending incrementing numbers. A similar thing happened, OK until the first page was full then the sorting went wrong but this time the new messages appeared at the top of page one (where expected) but message 08 was on page two, it changed again by the time there were three pages and the new messages were on page three.

There doesn’t seem to be any logic to the sort order from one thread to another, also the sorting was not the same for both accounts!

Still no errors in the log.

Anything else I can check?

YS Yellow Swordfish
Yellow Swordfish
Member

Old, pre-update threads have been a worry due to, as I said somewhere above, some anomalies in the data that made a few things unpredictable. Having said that, you are the only person (so far) who has appeared to have – or at least has reported – a problem.

I think the next thing we do is some testing to se if we can replicate your issue with new threads. One thing I would like you to confirm however is that you have no caching plugin at work here…?