privatemsg does not work when used with current HEAD revision of drupal.
several undefined functions errors when viewing inbox/sent messages, due to changes on API done for 4.7 head :
Call to undefined function: format_name() in
/drupal/head/sandbox/modules/privatemsg/privatemsg.module on line 539
Call to undefined function: check_output() in
/drupal/head/sandbox/modules/privatemsg/privatemsg.module on line 485
These are not bugs, but simply API changes.
i'm attaching a patch that :
- replace calls to format_name(...) with theme('username',...)
- replace call to check_output(...,...) by check_markup(...,...,FALSE)
which make the module works again. Additionnal checks should be made for full 4.7 compatibility.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | privatemsg-head.patch | 2.26 KB | syllance |
| privatemsg-4.7.patch | 1.54 KB | syllance |
Comments
Comment #1
moggy commentedMost of it seems to work fine with the patch.
However, there are no links appearing. This maybe a drupal problem. I'm not sure.
Comment #2
syllance commentedif you miss menu links, then you might need to adjust the access control for privatemsg. the view inbox link appear only for users having the "access private messages" permission, and you can also check on user profile for privatemsg activation, and daily email.
let me know if you still miss links. the patch works for me, but i may have broken something :p
Comment #3
moggy commentedUsing the latest version of Drupal HEAD I'm not getting any [em]"write to author" links under each node.
I'm logged in as a different user, and I've got all the permision set.
Before I updated Drupal I wasn't even getting the "add new comment" or "read more" links.
Comment #4
syllance commentedi'll look at it and post a new patch if i can find something.
note that head is still under heavy development. i'm facing a lot of small troubles like the one you submitted, so it may also be related to another issue, and i'm hardly waiting for a RC to submit all the small bugs I've found :)
Comment #5
syllance commentedthat sounds like normal. after code review, the feature write to author might only be configured in the settings, it is not implemented.
this does not sounds too difficult to do, so i'll add it when i've time. i'll also add in settings the "write to author" link toggled by node type. this might be annoying to get this link on node like product for example.
i'll post the patch in 2/3 days.
Is there any "official" privatemsg developer currently working on it ?
Comment #6
syllance commentedwell, sorry for my previous post. the write author link is implemented, but does not work. my code review was pretty fast and i missed the link hook that defines the links :)
i'll double check to make this feature work with head and submit patch.
Comment #7
TDobes commentedI'm the "official" maintainer, but I don't currently have a CVS HEAD development environment running anywhere.
As far as I am aware, the "write to author" feature works in the 4.6 version.
If you find the problem and submit a patch, I'd be happy to take a look at it and probably commit it. If not, I'll troubleshoot in a week or two once I get caught up a bit with the latest core development.
Comment #8
syllance commentedthe "write author" feature works fine with 4.6, but does not on head. sorry once again for my stupid mistake saying that was not implemented. where in fact i was not fully awake :)
my previous patch should make the privatemsg module work on head, but there's apparently an issue that prevent privatemsg_link from working correctly. the node ($arg) passed to the hook contains node & author info, but without the user 'data' fields in the user object, so the privatemsg_allow switch is not accessible, and the link is not displayed.
having checked, the node_load function in node.module does not unserialize/unpack the data field of author user record when loading a node. the author 'data' field is thus not usable and user prefs variables are not accessible. so that's why it does not work.
i've submitted this to drupal issues (http://drupal.org/node/31691), and in case this is an undocumented drupal api change, i'll modify my patch to unserialize the data field in the link hook.
i've attached a new patch. same as the previous one concerning head changes, but adds an additionnal check to avoid display of write author link in case the user viewing is also the author (then unless the user feels lonely, he might not need the link to write to himself :).
applying this patch, plus the patch posted for the node_load issue should make privatemsg works with head.
thanks for this nice module, hopefully now head compliant :)
Comment #9
mindless commentedHope it's ok, I'm doing some cleanup of privatemsg issues and I'm closing this one.
The theme('username' changes are in cvs, the FALSE param for check_markup is mentioned here and hook_link is covered here.