Closed (fixed)
Project:
Privatemsg
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2008 at 09:50 UTC
Updated:
1 Jan 2009 at 16:30 UTC
Jump to comment: Most recent file
Hi
after upgrade to drupal 6 and to privatemsg on drupal 6 (using patch in privatemsg issues because upgrade wasn't directly in module yet - 2 weeks ago)
Some of my users are sending me emails that they have permanent info about new messages in privatemsg menu and block, but actually they have no new messages in their inbox. They wrote that bug persists although they delete all their messages.
Do you have some idea for patch how to synchronize info about new messages with real state of users new messages?
Except this problem privatemsg works fine.
Thanks
Igorik
http://www.somvprahe.sk
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | privatemsg_unread.patch | 750 bytes | andypost |
| #8 | privatemsg_unread.patch | 1.22 KB | andypost |
| #7 | privatemsg_unread.patch | 1.23 KB | naheemsays |
| #6 | privatemsg_deleted_static_cache_unread.patch | 1.22 KB | berdir |
| #5 | privatemsg_deleted_static_cache_unread.patch | 1.55 KB | berdir |
Comments
Comment #1
naheemsays commentedcan you verify from the database (phpmyadmin?) whether there actually are new messages for those users...
the query should be something like "SELECT * FROM pm_index WHERE new = 1 AND uid = {uid}"
replace the uid there with the actual users.
If there are results, that means that there are some unread messages there, (you should get a list of which ones), so the problem is in displaying the messages.
(also, are you using in integration modules such as messaging?)
Comment #2
igorik commentedHi
I did you wrote on one concrete user and I found that:
In menu and block he has shown he has 2 new messages
In messages list he has no new messages in fact.
Sql query you worte to me returns 2 results:
mid thread_id uid new deleted
52377 52377 1409 1 1
52842 52842 1409 1 1
I don't use messaging with private messages. It is possible that I enabled this submodule some time ago (when i enabled notifications and messaging for the fist time) but I never use it.
Thanks
Igorik
http://www.somvprahe.sk
Comment #3
naheemsays commentedI see the problem - privatemsg version 5 allowed people to delete messages without reading them, and these messages have been "deleted".
However the current unread count is scanning through ALL messages, no matter if they have been deleted or not.
Attached patch should fix that.
(or you can run a query to set new = 0 where deleted = 1)
Comment #4
naheemsays commentedComment #5
berdirThe patch is fine, but I noticed that the privatemsg_unread_count() function is called up to 5 times (and atleast twice on every site because of the menu and the block), so I added a very simple cache using a static $unread variable.
Comment #6
berdirUps, the above patch had some debug code in it, which I forgot to remove.
This one should be fine
Comment #7
naheemsays commentedrerolled after current mega-patch.
Comment #8
andypostThis patch works fine but !is_null better to change to isset
Comment #9
andypostReroll,
maybe count "unread" per tag?
Comment #10
naheemsays commentedComment #11
naheemsays commentedpatch is rtbc, but what do you mean by "count per tag"? is that in conjunction with the filter module? if so, the work for that will need to go there. No idea how you would display it either.
Comment #12
berdirIs there a reason why you removed "my" caching stuff? It seems to got removed without reason, just wondering...
Comment #13
naheemsays commentedThat has already been committed: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/privatemsg/...
Comment #14
litwol commentedBerdir, your accounted only for a single user.
Comment #15
naheemsays commentedThe patch in comment 9 still needs to go in.
Apart from that, do we need anything else for the beta release, or is it good to go?
Comment #16
litwol commentedCommited. thanks.
@nbz: i think we need ability to delete multiple messages in single delete. for example deleting whole thread rather than per thread reply deletion. after that some general code cleanup and out goes the RC1.