Closed (fixed)
Project:
Coherent Access
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Oct 2008 at 10:19 UTC
Updated:
22 Apr 2010 at 09:40 UTC
Jump to comment: Most recent file
This error only appears when adding nodes that use coherent accesss. Other modules that use email are working correctly.
I am using Drupal 6.6
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | coherent_access-32572.3.patch | 2.88 KB | evoltech |
| #22 | coherent_access-32572.2.patch | 2.45 KB | evoltech |
| #19 | coherent_access-6.0-DEV-7Sep09.zip | 13.06 KB | snorkers |
| #6 | 325572.patch | 2.47 KB | swentel |
| #5 | 325572.patch | 2.51 KB | swentel |
Comments
Comment #1
abamarus commentedHaving looked into this I can see there is an error in the module code at line 506
drupal_mail($mailkey, $params['recipient']->mail, $message['subject'], $message['body']);
should be
drupal_mail('coherent_access',$mailkey, $params['recipient']->mail, $message['subject'], $message['body']);
The string 'coherent_access' may be incorrect but this does seem to get things working properly.
Now, where do I do to turn this into a patch rather than a hack on my copy of the module?
Comment #2
swentel commentedA lot more has to be changed, things like variable changing too. Ie, the mail I get looks liket his:
'You have been added as a Y for by"
I'll provide a patch as soon as I can!
Comment #3
abamarus commentedQuite right swintel.... my small change just gets rid of the error message. I just knew it couldn't be that simple ;o)
Comment #4
swentel commentedHi,
Attached patch fixes the mail issues. I also changed a few other small things:
- Space typo in settings page in subject.
- Added %recipient to the body of the mail.
- changed $inserts array - no matter what I tried, I always got the mail that I was added as an editor. Difference between editors & viewers is now also ok in the mail.
Happy testing!
Comment #5
swentel commentedOk, there is an error in the first patch, it doesn't save editors anymore.
This one fixes it. One error still though, the role in the mail is always editor no matter if you add editors or viewers. Going to look at it later.
Comment #6
swentel commentedOk, This one also fixes the role in the mail.
Happy testing :)
Comment #7
abamarus commenteduser_preferred_language($params['recipient']) on line 506 is returning an empty string and I do not get the notification email :o(
Am continuing to look into it
Comment #8
abamarus commentedOK ... user_preferred_language($params['recipient']) IS returning a language object (oh the joy of var_dump vs print!!!).
I'm still not getting my emails though and they are not quing up in the mail queue on the server. Will try on another server in case there is a server config issue.
Comment #9
abamarus commentedOK - more progress... tried it on the other server and while taking the time to do that all the emails turned up so it's an external issue to the module and the servers... phew!!!
Now I can fairly safely say that the patch works for me! Cheers!!!!
Comment #10
abamarus commentedsince no-one else seems to be contributing here I'll call this issue fixed. Good work swintel
Comment #12
kenorb commentedThis patch haven't been applied to the latest version?
Because my sent mail looks like:
Comment #13
MGN commented@abamarus. Please don't mark an issue as fixed when a patch is still under review/yet to be committed (unless you are the modules maintainer / co-maintainer). Perhaps you were trying to mark it RTBC and accidently chose fixed? For more information on the patch review process see http://drupal.org/patch/review .
I hope this helps...I am sure the maintainer will address the issue when he has time.
Comment #14
bradleygsmith commentedLooks like the patch fixed the email but seems as though a few simple bugs remain. We (dougvann http://drupal.org/user/222746 and I) tested the settings:
we created content-->a new blog entry
--we clicked the checkbox for 'Private'
--we added an editor
--we added a viewer
None of these settings remained when we went back to edit the blog entry.
--The 'Private' checkbox was not checked (which means saving now would make the page public)
--the editor does not show up (the user did not show up when we added this user to both editor and viewer | on a separate test, the user did show up when we just added the user to editor and NOT to viewer)
--the viewer does not show up
--We tested the node (blog entry) to see if it actually was private, and it is.
--We tested the editor to see if they could edit the node and they can.
--We tested the viewer to see if they could view the node and they can.
The module appears to be saving everything to the database, but does not always display the database info in the user interface when the admin comes back to edit the node.
Hope this helps.
Comment #15
MGN commented@bradelygsmith have you tried the patches that have been posted in the issue queue addressing these problems -
#361507: Private doesnt remain checked
#360651: Shared posts tab not showing on user account
#360460: rebuilding permissions makes private coherent_access nodes public
I think you will find that applying these patches will help. Hopefully the maintainer will have a chance to look at them soon so a working release can be made.
Thanks
Comment #16
snorkers commentedDid any of the aforementioned patches ever get committed? Just wondering as I'm seeing this issue having just migrated sites (and yes, the SMTP server is working...)
And I hadn't added a single thing in the Shared Editing section... so is that the problem - is a blank entry translated as 'User Unknown'?
Just wondering if this was ever really addressed, before I start chasing a whole host of potential other modules that could be conflicting (potential culprits may also include OG User Roles, Realname....). Seems to have no work on DEV since Feb 09, and none of the DEV changes have been rolled into a formal release.
Comment #17
snorkers commentedNot a blank entry issue. Just added a valid editor and same message still appears.
Comment #18
MGN commented@snorkers. No, the patch in #6 never got past 'needs work' after the review by bradleygsmith .
If you are up for it, you might try applying the patch in #6 to the latest dev (may need to do this manually, or ask swentel for a reroll), and see if you encounter the same problems as bradleygsmith did. Now that the patches listed in #15 have been committed, the patch in #6 might pass review.
Comment #19
snorkers commentedOK - finally got a chance to look at this.
Rolled the patch #6 against DEV, which succeded:
I've tested it a few times switching between 1.0 and the patched DEV:
In 6.x-1.0 I still get the error message for every node I create (as described ay #16); with the patched DEV the error does not appear. The patched DEV also appears to function correctly, sending an email to nominated 'shared' editors.
So I'll run with the patched DEV version for a while and see if any anomalies crop up. I have to go live this month, but this version seems more reliable than 1.0. *gulp*
Could I ask the rest of the community to review this code too (changed issue status, as 'Needs review' gets a little more attention - my apologies if I've broken any d.o protocol). It would be great if a new DEV could be re-rolled (I've attached a ZIP archive for those who are afraid of patching)... but it would also be great if a new release could be made for this very handy module before we are into the frenzy of migration to D7.
Comment #20
snorkers commentedSorry - forgot to mention bradleygsmith's issues (#14-15)... The checkbox stays checked (if selected). Editors/Viewers seemed pretty solid too, although one slight glitch when I hit 'Add Editor' before the autocomplete JS had caught up. The only user name that doesn't remain is User 1... which seems entirely logical anyway.
So as an update it looks pretty good to me. Anyone else?
Comment #21
snorkers commentedI've been using this tweak to the module and it's largely working... because Coherent Access wasn't working well without this patch to DEV, I hadn't really picked up any errors... so now I am getting 2 problems which may well be fresh issues, or could be related to the patch #325572-6: Unable to send e-mail. Please contact the site admin, if the problem persists.. If anyone else following this issue has spotted the following, please post here, otherwise I'll raise fresh issues against DEV:
1. When I create node, I get an email back to myself, saying that I'm a shared editor... even though I didn't add myself (or anyone else) to the shared editors list. Whilst it's kind of *nice* to get, I think it could become annoying, and is not the desired functionality of this module.
2. All 'shared editor' emails are from [logged in userid]@proofpoint2 (eg, snorkers@proofpoint2). I think Proofpoint is some sort of email security package that must be used by my university's SMTP relay... but why do all my other site emails come from the correct site email 'from' address and ones from Coherent Access have something else. It suggests that the Coherent Access emails may have the 'from' address incorrectly formatted and being passed out as userid rather than site address (assuming that the mail relay then adds '@proofpoint2' because it attempts to correct the format of the 'from' address). Other people may not be so lucky, so coherent access emails could well end up being filtered out or blacklisted if they are not formatted correctly.
Comment #22
evoltech commentedI tested this patch and can confirm that it provides a fix to this bug. I have re-rolled the patch (against DRUPAL-6--1) to fix the issue described by @snorkers in #21, regarding the emails from name@hostname. Emails now appear to come from the node owner's email (or editor's email that assigns permission if editors are trusted). I was not able to reproduce the issue raised by @snorkers in #21 regarding getting a mail sent two emails; one to the "shared editing changer" and one to the added recipient.
As a side note I noticed a few things that may be new issues or just FYIs:
*) The grammar in the subject and body will be incorrect if the added role is editor vs viewer. ie "You have been added as a editor" vs "You have been added as a viewer" in the first example should be "You have been added as an editor"
*) If a user is already a viewer and they are added as an editor, no new message about their change of permission is sent. This is also the case if their permission is revoked. Is by design?
*) A relatively larger than necessary data structure is passed through drupal_mail() for the third argument (optional parameters for message substitution). This is totally clean and may be a good point for refactoring where in coherent_access_mail we can just apply the substitutions with t().
*) The variables available for substitution are not documented anywhere. I think maybe this should be added as a description in the admin/settings/coherent-access forms.
Comment #23
evoltech commentedComment #24
evoltech commentedRe-rolling because I found another bug related to this issue that prevents users from getting an email reporting the correct role they had been assigned.
Comment #25
snorkers commentedThanks for the re-roll... does the patch at #24 also include the code addressed at #6 (32571_1.patch) ... just wondering whether to roll the patch #24 against the current coherent_access release (6.x-1.0 or 6.x-1.x-dev?), as the patch is rejected if rolled against 1.0 with patch 32571_1 applied apriori. A few of my modules are in configuration hell with applied patches - and this module's releases have not been touched now for over 8 months.
Comment #26
evoltech commented@snorkers, thanks for raising the questions in #25. Yes #24 includes the logic from #6, and I should have mentioned it, but this patch was made against a clean version of 6.x-1.x-dev.
Comment #27
snorkers commentedFinally got a chance to implement the patch against a clean DEV download - works just fine.
As soon as this patch gets committed to a new release [and configuration stabilizes] I'll investigate and raise the issue separately of 'You have been added as a viewer for
[new node]by[user]' email that is sent bu default to the person creating a new node. Still not sure if it's just a 'me' or a more widespread issue.Thanks so much @evoltech for working on this.
Comment #28
MGN commentedThis issue has been marked RTBC for about 20 weeks now. It would help to know if this is going to committed, or if some further action is needed. Thanks.
Comment #29
jgraham commentedThanks for all the work everyone, sorry for the long delay in getting this commited.