Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I was hoping to be able to create a privatemsg view and pull in private messages for a user into a block... Is there a reason why this module doesn't already have full views integration or am I missing something? Thanks in advance!
Comment | File | Size | Author |
---|---|---|---|
#157 | interdiff.txt | 3.35 KB | Jorrit |
#157 | 1573000-privatemsg-views-157.patch | 14.67 KB | Jorrit |
#139 | privatesg-1573000-with-thread-link.patch | 12.18 KB | dgtlmoon |
#120 | privatemsg-1573000-120.patch | 11.72 KB | tucho |
#118 | privatemsg-1573000-118.patch | 11.69 KB | andypost |
Comments
Comment #1
tbenice CreditAttribution: tbenice commentedI see now that there's no integration really. Here's a patch that did the trick for me. To get thread info just have to use the mid relationship. At least it's a start.
-Ted
Comment #2
tbenice CreditAttribution: tbenice commentedplease test...thnx!
Comment #3
meSteI get this error trying to use the thread_id
Broken/missing handler (Broken handler pm_index.thread_id)
Tried to create a view on messages with relationship to messages threads and also a view on messages threads with relationship to messages but I always get this error and can't access the thread_id but using a custom php field with a direct db select.
Except for this issue the patch seems to work nicely.
Comment #4
Nico7 CreditAttribution: Nico7 commentedSame error here. Could you please fix that?
Comment #5
tbenice CreditAttribution: tbenice commentedwill do. a bit pressed at the moment. i also need to add a new handler for the message body so that it can use tokens (currently fails on that). will get to it soon.
Comment #6
1kenthomas CreditAttribution: 1kenthomas commentedHi guys,
Seems like a few other threads on this issue are stalled and unaware of this patch/approach, as they wait on changes to this and other modules.
Can we summarize the differences between those approaches and this, and move towards either integration or clarification?
Happy to help on things such as removing the error above-- may need help replicating if the description above is not enough.
Comment #7
tbenice CreditAttribution: tbenice commentedMy idea behind this patch is to implement a baseline views integration to expose all of the pm related db fields in views. Also, I'm trying to expose the appropriate relationships and filters too.
@1kenthomas, would you mind making a list of the other threads that are relevant? I'd like to see what you're referring to above...thanks alot!
Addressing this patch is still on my list but I'm bogged down (still) with work. If you could try to address the above error that'd be super! If not then it'll wait for me to free some time.
Thanks a-lot!
Comment #8
1kenthomas CreditAttribution: 1kenthomas commentedSee http://drupal.org/node/1573000 and http://drupal.org/node/744374
Comment #9
tbenice CreditAttribution: tbenice commentedHi @1kenthomas,
Thanks. That first thread is this thread, and the second seems to be about adding the pm_thread table...which is there in 7.x. I think that this is the only issue trying to expose privatemsg tables to views.
I fixed the above referenced bug and added a new field handler to utilize token replacement on pm text-related fields that use tokens (subject and message).
Note, to allow token replacement, you must pull in the privatemsg id field into your display and enter that field's replacement pattern in the "ID of the Current Privatemsg (REQUIRED for token replacement)" options form field. Works great and uses the privatemsg_token_replace function so it acts just like the pm ui.
Please re-test! Cheers!
Ted
Comment #10
tbenice CreditAttribution: tbenice commentedneeds review.
Comment #12
1kenthomas CreditAttribution: 1kenthomas commentedMy bad-- must have posted wrong link, should have been drupal.org/node/1042154, I believe. Second link was an issue stalling first thread. Will correct as possible; now about to try your code.
Comment #13
tbenice CreditAttribution: tbenice commentedhuh, that's interesting re: drupal.org/node/1042154. I'm not sure why one would want a separate module for views integration. This patch should do the trick. I'm using it successfully for several projects.
Also, not sure why it failed testing. I don't know what to make of the simpletest failures. I'm going to re-queue.
-T
Comment #14
tbenice CreditAttribution: tbenice commented#9: privatemsg-full_views_integration-1573000-9.patch queued for re-testing.
Comment #16
tbenice CreditAttribution: tbenice commentedI don't know why the patch is failing testing on 'tags functionality' since the patch does not touch this functionality. Looking forward to a human test. thanks!
Comment #17
tbenice CreditAttribution: tbenice commentednew patch
Comment #19
Anonymous (not verified) CreditAttribution: Anonymous commentedmaybe you have to involve the tags functionality!?
Comment #20
1kenthomas CreditAttribution: 1kenthomas commentedPerhaps diff this version against the one that passed testing ?!?
/me's cliient had changed sftp password, so I'm going to try install again now...
Comment #21
tbenice CreditAttribution: tbenice commentedThe patch is against head so maybe the site is comparing to the latest dev release? I still don't get the failure mode (tags?).
Anyways, a human test will be great. Thanks!
Comment #22
noahlively CreditAttribution: noahlively commentedPlease see this patch, which deals with 2 things:
Comment #24
noahlively CreditAttribution: noahlively commentedMy patch failed testing, but it looks like the tests are totally unrelated to the patch.
I'm submitting a second patch. This one addresses a couple more bugs I found while using the original patch.
I've added a join instruction between pm_index and pm_message, like this:
I also changed the
views_handler_field_pm_new
class to inheritviews_handler_field_boolean
instead ofviews_handler_field_field
.Lastly, the thread_id field on pm_index was always rendering as a thread link. I changed the views handler for
$data['pm_index']['thread_id']
toviews_handler_field_numeric
and created a separate field for the thread link that usesviews_handler_field_pm_thread_link
, since there are occasions where the numeric thread ID alone will come in handy.See attached.
Comment #25
noahlively CreditAttribution: noahlively commentedChanging to "needs review"
Comment #27
tbenice CreditAttribution: tbenice commented@noahlively- thanks for the help! I was using a relationship to access the thread table but the join makes much more sense and is definitely the right approach.
The new patch applied cleanly and the views worked great. However, I noticed we neglected to add a relationship for recipient on the pm_index table so I added that. Now we have relationships to both sender and recipient that can be used to access user fields for both...so I don't think we need the user table joins. Do you agree?
Fresh patch attached.
Comment #29
zikaelismik CreditAttribution: zikaelismik commentedHello, i applied the latest patch but still have the broken/missing field error when creating new Privatesmsg Threading Index. Patch applied against 7.x-2.x-dev, could this be the issue in some way?
EDIT: i tried with 7.x-1.x-dev still got the same error, plus i got a SQL statement error:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_local.pm_disable' doesn't exist: SELECT 1 FROM {pm_disable} WHERE uid = :uid ; Array ( [:uid] => 1 ) in privatemsg_is_disabled() (line 377 privatemsg.module).
Sorry, this last error was not related to the issue, could be some mess in my test installation.
Anyway the handler error is still there, the sql error i got is about a join, only got this message:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM pm_index pm_index LEFT JOIN pm_message pm_message ON pm_index.mid = pm_mes' at line 1
showing the sql query in views gives me this:
I guess something is wrong with table names on the inner join
Comment #30
tbenice CreditAttribution: tbenice commentedHi zikaelismik,
1) yes the patch is against 1.x-dev not 2.x-dev. I suspect that it will break if patching the latter, but might work too. I haven't tested that.
2) you probably need to clear cache. I have verified that the patch will give broken handlers if you do not clear cache to rebuild views after applying. I have also verified that it works great after a cache clear.
Hope that helps.
T
Comment #31
rikki_iki CreditAttribution: rikki_iki commentedI'm getting the same broken/missing handlers & sql error on 1.x-dev even after clearing the cache. Is there something else I can try?
Comment #32
zikaelismik CreditAttribution: zikaelismik commentedThanks tbenice for your quick reply, unfortunately i'm stuck with that error even after clearing the cache. My other questions are:
1) which field is supposed to be there that gives that broken handler error?
2) i added a few custom fields to the messages, are those supposed to be accessible from views?
Thank you
Michele
EDIT: ok, patching against 1.3 works fine, anyway from what i understand the broken handler error doesn't compromise functionality, you just have to delete that field and manually add the thread id. am i right?
Question number 2) remains, correct me if i'm wrong, but from what i've seen, i suppose there is no easy way to load those fields from view.
Comment #33
tbenice CreditAttribution: tbenice commentedHi Michelle. The patch should work against 1.x-dev, very strange.
1) Can you verify that the new handler files are being created in privatemsg/views?
2) I haven't tried that. Since privatemsg is an entity, I think that views should just pick up your fields. That is unless there's something missing. I'll look at it.
Thanks!
Comment #34
zikaelismik CreditAttribution: zikaelismik commentedHi tbenice,
yes the files are there, and you're right about 2), the view picks up the fields correctly in messages now. What is still missing to me is the ability to filter by the id of the thread as a contextual filter. it just isn't in the list of available filters, the only ones i got are :
Privatemsg: Privatemsg Recipient
Privatemsg: Send Date
Thank you again for your responses!
Michele
Comment #35
tbenice CreditAttribution: tbenice commentedOh ok. I see what you're after. Actually, that wasn't implemented but it makes plenty of sense. I'll put it in and re-roll the patch.
-T
Comment #36
tbenice CreditAttribution: tbenice commentedHere's the new patch with thread id contextual filter support.
Comment #38
zikaelismik CreditAttribution: zikaelismik commentedThank you! It works perfectly :) Still i'm not able to pass the thread id from a panel page (messages/view/% overridden with page manager existing pages) to the view but that's totally another business!
Comment #39
tbenice CreditAttribution: tbenice commentedThanks Michele for the test. If the maintainer desires this in 1.x I think it's ready to be committed to that branch.
-T
Comment #40
igorik CreditAttribution: igorik commentedSo far I know 7.x version is based on 6.2x version,
so if you will add it for 2.x version, it can be used e.g. for 7.x version (if there is not something like this already)
Personally, I am very sceptic about any work for 6.1 version from Privatemsg maintainer.
Comment #41
gittosj CreditAttribution: gittosj commentedThis issue was a deal-breaker for me. Thought it might be useful to mention how important it is since privatemsg would not fit / integrate with any of the use-cases / ui designs I had. As a result I've put together my own content-type called message using entity reference for the to: field etc. Far more flexible. Privatemsg seems like a great module but far too monolithic & inflexible.
Not meant as negative criticism but hope it makes clear how important views integration etc are.
Comment #42
superdorx CreditAttribution: superdorx commentedI know this is not related to this post but I am very curious to know how to pull this off with entity reference? Is there somewhere you can share your process? Thanks
Comment #43
ryan.merritt CreditAttribution: ryan.merritt commented#36: privatemsg-full_views_integration-1573000-36.patch queued for re-testing.
Comment #45
tbenice CreditAttribution: tbenice commentedPutting as reviewed. I have no idea why the tags test fails. Would love to get this committed to 1x and later to 2x (unless there is a different approach in 2x).
Comment #46
ryan.merritt CreditAttribution: ryan.merritt commentedThe most recent patch worked perfect for me!
Comment #47
Kristen PolI am trying out the patch from #36. When I use the "Privatemsg Threading Index" option, I get a broken handler error. See attached screenshot.
Comment #48
Kristen PolI've tested the "Privatemsg Message" view and it works well so far! Good job :)
Comment #49
plessas CreditAttribution: plessas commentedI have also tested the last patch and it seems to work. In the view i created i am able to get the messages of which the logged in user is the recipient of, however as i am trying to clone the functionality of this module "messages" page, i would like for each thread to show the most recent message only. Is there any way to make this grouping through the views UI? I have read that pragrammatistically this could be done by altering the query with views_pre_execute hook.
Another question i have is if it is possible in the bulk operations section to define "Mark as read" and "Mark as unread" actions. I was not able to find such an option.
Thanks in advance!
Comment #50
superdorx CreditAttribution: superdorx commentedAny plan for this to be pushes to a fully release?
Comment #51
DrupalDan CreditAttribution: DrupalDan commentedsub
Comment #52
DrupalDan CreditAttribution: DrupalDan commentedPatching #36 is not entirely cleanly made. After applying the patch there was a line indicating there were some add whiteshapce errors. I don't quite understand what that means so I proceeded to create a privatemsg view to find out more, and then I added all privatemsg related fields and show them as a table. Here is what I found:
the message author and recipient were referred as user ID, not name (not sure if it is designed so or not, but if it is, perhaps it would be better if it is the name shown), and it seems that for now there is no way for users to change that
I deleted existing two messages for all users but those two messages are still shown in the view. This is very strange. To see if the messages really got deleted I log in as sender and recipient and yes, the inbox says "no messages available". I suppose this has nothing to do with clearing cache or not but I did that anyway and still, the messages are shown in the view. Most importantly, the View Thread is still alive, which directs me to the page with that message, the one where there's a delete link. I clicked that link and ticked the "Delete this message for all users?" and then "Delete". When I got back to the view, update it, the messages are still there; all are the same. It's like I can delete it for a million times.
A screenshot is attached.
Comment #53
yce CreditAttribution: yce commentedFor me the patch at #36 with 1.3 works, but I had to fix it a little, because if the full_html format is disabled, nothing would appear on views fields.
check_markup() will fallback to a given format if
$this->get_value($values, 'format')
is empty.http://api.drupal.org/api/drupal/modules%21filter%21filter.module/functi...
Comment #54
yce CreditAttribution: yce commentedA little fix for the previous fix :) sorry for that.
Comment #55
superdorx CreditAttribution: superdorx commentedHas this been integrated into the latest dev version? Just saw a new version was released the day after post #54 with the latest patch.
Comment #56
czigor CreditAttribution: czigor commentedAccording to http://drupalcode.org/project/privatemsg.git/shortlog/refs/heads/7.x-1.x it has not.
Comment #57
yce CreditAttribution: yce commentedI added a new filter for privetamsg view. It can now filter by messages which marked for deletion.
Comment #58
tofo1977 CreditAttribution: tofo1977 commentedHi folks :)
i got privatmsg 7.1.-1.x latest dev running and try to patch on my console with the last one from 31.1. maybe im stupid but i get message back "cant find input files". is it possible to got a little howto how i can apply that patch?
thanks & regars
Tom
Comment #59
fraweg CreditAttribution: fraweg commentedHello Tom,
copy the patch into the module folder (..sites/all/modules/privatemsg). After that open a console and type in this folder:
patch -p1 <thepatchname.patch
Best regards
Frank
Comment #60
yannickooPlease remove that and clone the git repository and then apply your changes.
Whitespaces
Whitespaces
Whitespaces
Whitespace
Whitespaces
Whitespaces
Whitespaces
Comment #61
yce CreditAttribution: yce commentedRemoved whitespaces (sorry for that).
Fixed the new message indicator field.
Comment #62
yannickooThank you for the new version of the patch but found some issues again - sorry ;)
I told you in #60 to not use the development version of this module. You should clone the Git repository (
git clone --branch 7.x-1.x http://git.drupal.org/project/privatemsg.git
)BTW why you are not using the 2.x version instead of 1.3? I guess that new features goes into 2.x but I don't know :/
Minor notice but why you are using such a comment style?
// Private message table
looks more like coding standards.Why do you uppercase "Author"? Is it a song? ;) I think "Message author" would be better because other fields haven't the title uppercases. But that is a minor issue.
Comment #63
igorik CreditAttribution: igorik commentedI am curious if something like this will be for 7.2x version this year :)
it is really hard to understand why privatemsg 7.2x is not already based on views
Comment #64
dawehnerFixed some points all over the places.
I really didn't got on handler: views_handler_field_pm_markup
As far as I understand the goal is to render the message of the result row as field. Do we really have to force people to set the token, because the pmid should be available on the sql result.
In general here is a cleanup of quite some code.
Comment #65
sol0matrix80 CreditAttribution: sol0matrix80 commentedok after hours of trying to figure it out i was still unable to get views to display the fields i wanted using relationship am i missing something ?? i have tried privatemsg-1573000-64.patch & privatemsg-full_views_integration-1573000-61.patch still cant make a relationship. Can someone post a step by step please any help is greatly appreciated
Comment #66
tbenice CreditAttribution: tbenice commentedHey dawehner, The reason for views_handler_field_pm_markup is that it is needed to render any token replacement from the messages in the view. Without it if a user uses token replacement in a message then the tokens are rendered in the view as the raw token values. Kindof a fail.
Comment #67
dawehnerCool, thanks for the explanation.
One thing i'm not sure about at the moment is that you have to specify the token for the mlid, is there a reason for that? The code should be able to automatically determine the mlid in the result, wouldn't it?
Comment #68
xbrianx CreditAttribution: xbrianx commentedI am using this patch - privatemsg-1573000-64.patch
One thing I am getting is Html markup displaying in the view. For example if i display the field of Privatemsg: Message it will out put
<p>TEST</p>
instead of just TESTComment #69
xbrianx CreditAttribution: xbrianx commentedAnother weird thing, After I delete the message, it is still showing the message in the views display.
Comment #70
Kristen PolFyi... I have used the patch in #64 and it works pretty well. There are some shortcomings (e.g. for example, no filter by message id) but I think it is good enough to get into PM!!! We can have follow up issues for the polish, no?
Btw, here's a post I wrote about having troubles creating an admin dashboard for PM messages:
http://www.kristen.org/content/drupal-misadventures-configuring-private-...
:)
Comment #71
Kristen PolSome things that would be handy to have are:
* Filter by recipient
* Filter by author
* Filter by send date
And for fields, the option to link fields to the private message thread, e.g. if you add a thread id field, it has a checkbox for linking to the thread link.
:)
But, I'm cool with committing this "as is" so that this bit of functionality gets in!
Comment #72
Kristen PolBtw, I'm filtering (exposed) by author and recipient using a relationship so that works well! :)
Comment #73
ptmkenny CreditAttribution: ptmkenny commented2.x is the new features branch. This definitely qualifies as a new feature.
Comment #74
ptmkenny CreditAttribution: ptmkenny commented#64: privatemsg-1573000-64.patch queued for re-testing.
Comment #75
ptmkenny CreditAttribution: ptmkenny commented@Kristen Pol I don't think we can say this patch is ready yet because, at a minimum:
#66 token support is broken
#68 HTML markup appears as plaintext when it should be rendered
#69 deleted messages not actually deleted
At the very least, these reported issues need to be investigated.
Comment #76
Kristen PolAh... well, the delete feature works fine because private messages aren't permanently deleted until the date configured in your PM settings at:
To get the "deleted" private messages to not show up in the view, you need to filter by the PM "is deleted" filter.
So... I don't think anything should be done for this patch regarding the deleted messages as this is how PM is designed... right?
But, token and HTML support sound good. Hope those aren't too hard to do.
Comment #77
tbenice CreditAttribution: tbenice commentedHey yall, i'm surprised that html is not rendering as that's what the *_pm_markup handler was there for. It extends the markup views handler. Maybe something regressed along the way? Not sure about the token support.
Thanks for grabbing onto this. It'll be awesome to replace my fork with a supported release!
-Ted
Comment #78
Kristen PolI'm running into an issue where the view results show up for admin users but not non-admin users. I tried turning off field_permissions with no luck. I also tried granting all roles all privatemsg permissions and it still didn't fix it. I don't have any content access modules enabled.
Anyone have any thoughts on why I don't see messages via views for non-admins while I can see them in the default PM pages (e.g. messages/sent).
I'm perplexed :/
Comment #79
Kristen PolIt is something about that particular view itself because I made a super simple view and can see the results from different roles. I'll post back if when I figure out the issue.
Comment #80
tbenice CreditAttribution: tbenice commentedBe careful with relationships. Sometimes they can cause such access issues. Try setting the view query settings to ignore sql rewriting.
Comment #81
Kristen PolThanks for the tip @tbenice! I will try that :) I have a ton of relationships :) I'll figure out how to set views to ignore the rewriting.
Comment #82
Hydra CreditAttribution: Hydra commentedWell, dawehners patch in #64 is working well, I share Kristens opinion. It would be great to get this in as a basis, to implement even more great views stuff. For example would it be nice to be able to aggregate threads, to aim the functunallity of the /messages page. But this would make this patch more complex, we can do this in followup's.
About the issues in #75, we should create follow ups for them as well. It will be easyer for people who are willing to contibute to that, if they don't need to understand and work through the full views integration patch in #64.
Code looks decent, manuel testing did was I expected the code to do, so for me this is RTBC. Let's hear what the maintainers think about it :)
Comment #83
Kristen PolI agree with @Hydra! :) RTBC++
Comment #84
bennos CreditAttribution: bennos commentedlong thread.
looked at the last patch https://drupal.org/node/1573000#comment-7329124
tested it and it works, basic stuff for views, but now we have start with the basic stuff
would be nice to get this in the dev version.
think it will create a lot of followup issues and feature request.
Comment #85
igorik CreditAttribution: igorik commentedGood work!
would be great to have it commited into 2.x version
Comment #86
ptmkenny CreditAttribution: ptmkenny commentedNeed to make clear that what is RTBC is partial, not full Views integration.
Comment #87
andypostGot the same as #47 also there's no way to use filters - author or recipient at least
Comment #88
Cromian CreditAttribution: Cromian commentedHas anyone had any luck creating a delete link for messages through views? I.e. in the listing have a delete thread link just like we have a view thread link.
- C
Comment #89
tbenice CreditAttribution: tbenice commentedThose are both great suggestions. However, can we please get this "preliminary" views integration in and then start new issues to address 87 and 88?
Comment #90
pinkonomy CreditAttribution: pinkonomy commentedHow can I use this patch? #64
I have applied to the version 7.x-1.3 and i tried to create a view.But there is nothing to do with private message.
Any instructions please?
Comment #91
Hydra CreditAttribution: Hydra commentedYeah WT*.
Let's get this in, to have a base to work with. This issue does not a full views integration with all the needy features we want and need, "Preliminary Views integration" is what this issue is about, so please, just let us get this ready and create followups.
@tbenice: Just set it back to RTBC
@pinkonomy: you need to apply it to the latest git version. If you don't have experience with patching, check out the dokumentation pages -> https://drupal.org/patch
Comment #92
pinkonomy CreditAttribution: pinkonomy commented@Hydra:I patched the 7.x-1.x version.Is this correct or should I apply to 7.x-2.x version?
What should I do next after patch applying?
Comment #93
tbenice CreditAttribution: tbenice commented@pinkonomy- did you clear cache? That has to happen for views to pick up the new handlers.
Comment #94
pinkonomy CreditAttribution: pinkonomy commented@tbenice I cleared Cache and yes,I can see private messaging when creating a new view,thanks!!
Comment #95
pinkonomy CreditAttribution: pinkonomy commentedIdea:Use Views bulk operations for the Actions (Delete,Mark as unread,Mark as read).
Also use Exposed filters to filter for Inbox,Sent messages,All messages.
thanks!
Comment #96
Majdi CreditAttribution: Majdi commentedI'm building website need private message features, I try this module , The main problem i found That the module is not integrated with views, and I have complex requirements from the designer, I check the theming ability private message module, i found it a bit complex and its don't give you want you want.
this lead me to think how I can build this module using what Drupal have
basically we have Entity, Views, Views Bulk operation using this 3 modules I end up with the 80% of this module functionality and that was fair enough for the requirements I have.
It was a bit confused to create that views with relations but I manage to do it
I attach image for the result I have.
I really think this module should be written in different way for Drupal 7 +
Comment #97
ptmkenny CreditAttribution: ptmkenny commentedI talked to Berdir (the maintainer) and he wrote the following:
So, I am postponing this issue until we can get #744374: Introduce a pm_thread table working and ported to D7.
Comment #98
Kristen PolThe patch from #744374: Introduce a pm_thread table is from 2011 :/ Is someone going to be working on that issue soon?
Comment #99
ptmkenny CreditAttribution: ptmkenny commentedYes, unfortunately #744374: Introduce a pm_thread table is a D6 issue that needs to be fixed in both D6 and D7.
It would be great if someone stepped forward, but as of right now no one has (to my knowledge, and I've cleaned up about 100 issues in this module's issue queue in the past month).
Currently, working patches (that have tests) are being committed, but I think it's fair to say that no new features are actively being developed at this point.
Comment #100
tbenice CreditAttribution: tbenice commentedalright, i'll just keep maintaining my fork for the time being. thanks!
Comment #101
igorik CreditAttribution: igorik commentedHi,
no offense, I highly respect work of Litwol and Berdir work on privatemsg module for last 7 years.
However, #744374 issue is dated March 16, 2010, and currently nobody is working on it, I think, so we are in the circle and this (preliminary views issue) will be IMHO probably never done same as pm_thread table issue. :(((
So the only option I can see it will be probably to do on addon for message module for using it as substitute privatemsg.
Comment #102
Kristen PolThis is unfortunate. I will likely need to rip out my PM views then as it's too risky to use it now. I thought with all the RTBC comments that the views stuff would get in soon but it's clear it won't. I don't know enough about the inner workings of PM to attempt to the the thread table patch.
Sigh.
Well, I can't abandon the module entirely as I've already integrated it heavily into my site so I will either:
* Maintain a customized version of this module with the views integration in place - this will make upgrading to D8 tricky
or
* Not use the views integration and write some code to show what I want to show in various places - safer but more work now
Tis a sad day in Drupal-land but thanks to everyone for their hard work! Who knows... maybe someone will dive in and tackle the thread table beast.
Comment #103
herosen CreditAttribution: herosen commented#64: privatemsg-1573000-64.patch queued for re-testing.
Comment #104
ptmkenny CreditAttribution: ptmkenny commentedMoving back to postponed since the re-test is complete.
Comment #105
herosen CreditAttribution: herosen commentedplease give a link to the patched version, I did not get patched
Comment #106
ptmkenny CreditAttribution: ptmkenny commented@herosen: You can find the documentation on how to apply patches here: https://drupal.org/patch/apply
Comment #107
alesr CreditAttribution: alesr commentedIf Privatemsg doesn't support Views integration yet.. is there an alternative to have private messages with views support in Drupal?
Comment #108
ptmkenny CreditAttribution: ptmkenny commented@alesr I don't think there is another all-in-one solution like Privatemsg, but you could try making a custom solution using the Message, Entityreference, Rules, and Views modules, which all integrate with one another. Even for a basic use case, though, my guess is that this would be a lot of work.
Comment #109
igorik CreditAttribution: igorik commentedThe best thing for the future is move out from privatemsg to message, as soon as possible.
Comment #110
alesr CreditAttribution: alesr commentedI'm using Message module for activity stream and Message Notify for sending invites.
"Message stack" with message types defined is good for storing and sending system generated messages.
I don't see how Message could replace Privatemsg without a lot of custom coding.
As I see it, Message would still need most of Privatemsg functionallity to support all features like, reply, correct listing between users, etc..
Maybe a module which implements Message and adds this would be an option. Do you have an idea?
Comment #111
muschpusch CreditAttribution: muschpusch commentedmessage module isn't meant for the usecase of privatemsg...
Comment #112
igorik CreditAttribution: igorik commentedyes, now, but it could be I think, with some work about user relationships
Comment #113
Ditiwi CreditAttribution: Ditiwi commented#64: privatemsg-1573000-64.patch queued for re-testing.
Comment #114
ptmkenny CreditAttribution: ptmkenny commentedComment #115
druvision CreditAttribution: druvision commentedThe latest patch (#64) applies against privatemsg 6.4 except for one file - privatemsg.views.inc - which is not found.
Comment #116
ptmkenny CreditAttribution: ptmkenny commentedJust a reminder that #744374: Introduce a pm_thread table must be completed _before_ this patch can be finished, so work should start there...
Comment #117
andypostComment #118
andypostUpdated patch:
- used real column names
- subject and body should use replacement when needed
- strings are changed
- added sorts and filters
EDIT patch implemented in sandbox module
views_privatemsg
https://drupal.org/sandbox/uzlov/2149597Comment #119
mttjn CreditAttribution: mttjn commentedAs in #95, is there a way to set up distinct views for inbox and sent messages?
I've tried various configurations in views but I can't get this. Can only manage to show all messages pertaining to the logged in user, both received and sent.
Would be grateful for any suggestions.
Comment #120
tuchoI applied the patch from #118 and it works fine.
But I got the following error when using the "Subject" field in a view:
I just added the format to the subject field of pm_message to the patch.
'format' => 'plain_text',
Comment #121
No Sssweat CreditAttribution: No Sssweat commented#120 worked for me, cheers to everyone who has worked on this.
I noticed that it doesn't work with views bulk operations. I tried to do a bulk delete, but it doesn't delete them. Would be nice if it can be added.
Comment #122
drupal a11y CreditAttribution: drupal a11y commentedHas anyone tried to work with Views & VBO? I would like to delete messages and mark them as "read/unread" like in the default installation page under "/messages" but somehow "delete" does not work nor "mark/unmark as deleted".
Any patches available?
Comment #123
gladiatorhl2 CreditAttribution: gladiatorhl2 commentedI applied #64 patch (7.x-1.4) and there is an error Broken/missing handler (Broken handler pm_message.privatemsg_body). Is something missing? I tried other patches and they don't work either.
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM pm_message pm_message LIMIT 10 OFFSET 0' at line 1
I suppose that this happens because of the newest version of Views?
Privatemsg 7.x-2.x-dev doesn't work for Drupal 7.31 or isn't it possible correctly update from 7.x-1.4 to 7.x-2.x-dev?
Comment #124
JulienThomas CreditAttribution: JulienThomas commentedGood morning.
Just to confirm, #120 works really like a charm and let me built a 4 tabs panel with new / received / sent / trash.
Really good patch !
Thanks.
Comment #125
gladiatorhl2 CreditAttribution: gladiatorhl2 commentedOn which versions of Drupal, Privatemsg and Views?
Comment #126
JulienThomas CreditAttribution: JulienThomas commentedThe dev version for privatemsg (2.x-dev) and Drupal 7.31.
However, I confirm VBO is not working, no matter the setting among the 4 following possibilities:
skip confirmation yes/no
queue operation yes/no
Comment #127
gladiatorhl2 CreditAttribution: gladiatorhl2 commentedWhat about Views?
Comment #128
cbrody CreditAttribution: cbrody commentedConfirming that the patch in #120 doesn't work on Drupal 7.32 with Views 7.x-3.8
Comment #129
darol100 CreditAttribution: darol100 commentedI'm developing a dashboard and I want to be able to show 10 private message and they have to be sort by the newest activity (similar of how the dashboard of the post on Drupal works). If they new message should be able to show on top. This is a views block so I can have it on my dashboard. However, I was not be able to do this with this patch is this is supported on this patch ? Or I did something wrong ?
Here is the configuration page - http://i.imgur.com/exQAsyD.png
And here is the ouput - http://i.imgur.com/OBkucTo.png
The problem that I'm having is that the "New Message" are not longer new and does not update the view like it supposed too. They have been read it and for some reason still showing off there. And I'm not sure if I did something wrong or this is not currently supported.
I'm using the latest version of Views 7.x-3.8 on Drupal 7.34.
Comment #132
ptmkenny CreditAttribution: ptmkenny commentedFor those of you trying to use this on the latest versions (Privatemsg 2.x-dev, Views 3.10, and Drupal 7.34), I wasn't able to get the patch in #120 working, but I was able to use the sandbox module in #118 with the fix described in #120.
Comment #133
igorik CreditAttribution: igorik commenteddoes it work with views 3?
Comment #134
ptmkenny CreditAttribution: ptmkenny commented@igorik Yes it does, sorry I typed the wrong version No. I have updated my post (#132).
Comment #135
cmonnow CreditAttribution: cmonnow commenteddarol100: From a quick check of the sandbox module (+ single line in #120) it appears that is_new works as expected but that's from a few minutes experience.
I haven't tested VBO but I'm already delighted to potentially have a display view.
I used the module Views Distinct (https://www.drupal.org/project/views_distinct) to simulate a dashboard view that would show threads with new messages in descending order (I filtered by thread id in Views Distinct field settings so that only the last message and its respective date would represent the updated thread (somewhat analogous to Facebook, except Facebook renders only the last line of the last message)). Based on the way the module works though it makes page limits not work as desired after removing duplicates. Since I use PostgreSQL I suppose I'd have to hack the SQL to use ROW_NUMBER() to achieve what I want (MySQL's default behaviour is simpler).
Comment #136
cmonnow CreditAttribution: cmonnow commentedI believe that views_handler_field_pm_thread_link.inc should also give us the option to not display as a rendered link for greater extensibility (e.g. using the link outside a div).
Suggested update:
Comment #137
darol100 CreditAttribution: darol100 commented@cmonnow,
Can you created that into a patch ?
Comment #138
dgtlmoon CreditAttribution: dgtlmoon commented(ignore this one) sorry :/
Comment #139
dgtlmoon CreditAttribution: dgtlmoon commentedComment #140
jlbellidoThanks! Let's test it.
Comment #144
cmonnow CreditAttribution: cmonnow commentedHi,
Sorry I've been away.
I've never even bothered to test the patch in #120 after I read in #132 that it didn't work. I've been using the sandbox module at https://drupal.org/sandbox/uzlov/2149597.
Beyond that, I was under the impression this patch would never make it unless the whole pm_thread table was issue was finalised (https://www.drupal.org/node/744374), which appears stagnated.
Comment #145
dgtlmoon CreditAttribution: dgtlmoon commented@cmonnow yes i think so too, but good to keep the patches organised
Comment #147
darol100 CreditAttribution: darol100 as a volunteer and commentedI can confirm that the sandbox https://drupal.org/sandbox/uzlov/2149597 would work fine.
Should we take the sandbox and integrate with this project as a sub-module ?
Comment #148
igorik CreditAttribution: igorik commenteddoes dandbox project work with privatemsg 1 or 2? Thank you
Comment #149
ptmkenny CreditAttribution: ptmkenny commented@darol100 The sandbox will not be integrated as a sub-module of this project because #744374: Introduce a pm_thread table is a prerequisite and the sandbox module needs a full suite of automated tests, like this module already has for its existing features.
@igorik You're best off using the 2.x-dev branch with the sandbox module.
Comment #152
brandonc503 CreditAttribution: brandonc503 commentedhi. thought id comment, im using the privatemsg module and am looking to get the messages in views so this seems like right place.
Comment #153
brandonc503 CreditAttribution: brandonc503 commentedon privatemsg i have entity reference to node. im placing view block on /message/view/* in order to show the node that is referenced to the message.. im getting this error when i add field of my entity reference, or when i try to render entity as view format show.
i was looking for the contextual filter for the privatemsg in url.
i was looking for the render entity field to add.
i dont code but let me know what should be done and ill try to find someone to help.
tnx :)
drupal: 7.41
views: 7.x-3.11
module: 7.x-2.x-dev
patch: privatemsg-1573000-120.patch
Comment #154
brandonc503 CreditAttribution: brandonc503 commentedim also getting this error on site.com/messages
Comment #155
brandonc503 CreditAttribution: brandonc503 commentedI used the privatesg-1573000-with-thread-link.patch and seems to be working without error.
Comment #156
misterpo CreditAttribution: misterpo commentedHi,
Would anybody share a Privatemsg view including messages folder ?
I am trying to use Privatemsg with OG and I need to use Content panes.
Thanks in advance for your sharings.
Comment #157
Jorrit CreditAttribution: Jorrit at nCode for DOM Digital Online Media GmbH commentedI have added a number of features to #139 that I need because I use privatemsg_groups and I also have a custom recipient type:
Hope you like it.
Comment #158
Northern_Girl CreditAttribution: Northern_Girl commentedJust in case no one saw this :Privatemsg message views (https://www.drupal.org/project/privatemsg_message_views).
Would that help with "Preliminary Views integration" ?
NG
Comment #159
ivnish CreditAttribution: ivnish commentedComment #160
andypost@ivnosh please work on 9.x compatibility and stop closing issues you have no clue