Changes introduced by the patch:
- A hidden flag for the pm_tags table (Hidden tags are not shown in the UI)
- A new "Inbox" tag, which is automatically created upon update/enable of the module.
- That tag is added for all recipients when a message is added.
- Instead of a huge HAVING, all we have to do now is add the Inbox tag to the filter
- Update function that adds Inbox tags to all message that are currently in the inbox
- An "Archive" Button, that allows to remove that Inbox tag
Please test but be aware that this hasn't been tested very well. It does only extend the schema/data so it *should* be save to remove the patch again.
This is imho required to fix #502664: remove duplicate records from pm_index and add primary key
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | privatemsg_inbox_tag10.patch | 16.75 KB | berdir |
| #21 | privatemsg_inbox_tag9.patch | 11.02 KB | berdir |
| #18 | privatemsg_inbox_tag8.patch | 9.98 KB | berdir |
| #15 | privatemsg_inbox_tag7.patch | 9.08 KB | berdir |
| #12 | privatemsg_inbox_tag6.patch | 9.6 KB | berdir |
Comments
Comment #1
naheemsays commentedyou AFAIK still won't be able to remive the author uid - just avoid duplicate data in that table as it would no longer be useful.
Comment #2
berdirCorrect :)
Comment #3
berdirRe-roll of the patch to check qa.drupal.org integration and push the issue to the top :)
Comment #4
berdirAutomated test are not yet reported back, but they work!
The updated patch should pass all tests....
Comment #6
berdir#4: privatemsg_inbox_tag3.patch queued for re-testing.
Comment #8
berdirTrying to figure out what's going wrong with the test bot.
Comment #10
berdirPage not found error on edit tag url, strange. Adding more debug stuff.
Comment #12
berdirI think I got it. The test bot doesn't have clean url's enabled and drupal is inside a subdirectory.
While the new approach of that patch is still hacky but it should work. Let's see.
Will commit that fix as a separate change if it works.
Comment #13
berdir#12: privatemsg_inbox_tag6.patch queued for re-testing.
Comment #15
berdirRe-roll.
Comment #17
berdir#15: privatemsg_inbox_tag7.patch queued for re-testing.
Comment #18
berdirImproved the upgrade function, it does now go through all threads and processes them groupwise instead of looking for inbox messages over all users.
This is a huge scalabilty improvement, I've tested it with 2mio pm_index entries and it finished in a few minutes. The old version worked an hour without actually doing much.
I've also re-added the archive submit callback, which got lost in one of the earlier patches.
Warning: We probably need to do something about #717876: PM_Index ridiculous size. first, if we get more reports about that. the upgrade function will not convert the messages with thread_id 0. But, they won't show up correctly anyway right now.
Comment #19
naheemsays commentedOk, just been playing with this:
1. There was no inbox tag (nor the variable "privatemsg_filter_inbox_tag") created for me when updating from privatemsg 1.1 - which leads me to assume the if statement in privatemsg_filter_update_6003 is wrong.
2. Moving on from 1, the new rows in pm_tags_index were created - with the tagid of 0. This actually made the functionality work (but then resaving the tagging data obviusly removed the 0 tag_id, breaking the finctionality again).
3. Enabling privatemsg_filter DOES create the new tag. However, the enable also needs to call privatemsg_filter_update_6004 in order to tag any previously sent/recieved messages.
4. I cannot get the archive button to show.
5. When tagging threads, the inbox tag is auto removed. There needs to be some check here to see if the tag previously exists and if so, to add it to the list of tags to be added.
Comment #20
naheemsays commentedComment #21
berdirThanks for testing..
- Yeah, the broken update was my typical error : "if ($var = do_stuff() || do_other_stuff())" does *not* what you expect from it. It's actually "if ($var = (do_stuff() || do_other_stuff()))" instead of "if (($var = do_stuff()) || do_other_stuff())". This is fixed, updating should now work.
- The Archive button was missing because a necessary change in privatemsg.pages.inc was missing from the patch. Fixed and added a basic test for that feature.
Comment #22
naheemsays commentedComment #23
berdirOk, this is a first version with an admin page to rebuild the inbox by using batch api. seems to work fine for me...
Also displays a message informing users that enable the module to visit that page. And fixes the bug described above.
I'll add some tests for both the admin page and the fixed bug if I find some time...
Comment #24
crea commentedSubscribing
Comment #25
YK85 commentedsubscribing
Comment #26
naheemsays commentedThis may be weird, but the tagging process seems to miss out a particular thread when adding the inbox tags.
Originally it had no replies, but since I have added one and it still is the case. I cannot see how it is different from all the other threads though.
And that one thread seems to be the only problem I can find.
Comment #27
berdirYou tested the admin rebuild stuff and everything worked fine? Good.
Something that came to my mind is that we will need to adapt that once this and #502664: remove duplicate records from pm_index and add primary key because we will not be able to mark threads/messages that users sent to themself, but imho, we can live with that. The upgrade path will still work though.
What do you think, should we commit this so that we can continue with issues like #502664: remove duplicate records from pm_index and add primary key or wait until we've figured out what's up with that strange thread of yours? ;) Imho, it should be rather safe to go forward, we can't loose any data with this, atleast not without that other issue I've linked twice already :)
Oh, and regarding that thread, was that sent to another user or yourself, did you send it after/before the upgrade, .. ?
Comment #28
naheemsays commentedBefore the upgrade. I think the second that should have been tagged. But i still think this should be comitted asap
Comment #29
berdirOk, I've commited this, let's see if we receive any bug reports about those threads or you can figure out something.
Comment #30
berdirAlmost forgot about 7.x :)
Comment #31
berdirCommited the ported patch to D7 and also fixed dozens of broken tests due to changes in core.