Closed (fixed)
Project:
E-mail This Page
Version:
master
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
6 May 2006 at 18:15 UTC
Updated:
15 May 2006 at 09:00 UTC
Jump to comment: Most recent file
Same has happened for me.
4.7.0
PHP Version 4.4.2
MySQL Version 4.1.18
'From' or 'Reply to' email address does not go out with email. I cannot even see where Same has happened for me. There are four references to a variable get for 'emailpage_sender_addy', but I cannot see how it can get something without a method of doing that. The variable is not named anywhere and I am seeing no queries to a DB.
Somehow, I think this module got disconnected from a DB.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | emailpage_2.module | 15.74 KB | AjK |
| #7 | emailpage_1.module | 10.96 KB | zoo33 |
| #2 | emailpage_2.patch | 7.24 KB | zoo33 |
Comments
Comment #1
zoo33 commentedThe problem I think is due to the lack of a default value in two calls to variable_get().
variable_get('emailpage_sender_addy', '')should bevariable_get('emailpage_sender_addy', "NoReply@".$host['host']).Comment #2
zoo33 commentedRight, I made a patch. However, I've been working on a number of other issues with the module as well (including solutions by other contributors in different issues) – so the patch is pretty big. Here's a list of what I did:
I hope you guys are ready to review this patch, even though it deals with so many things at once. If it's committed I think we'll solve a lot of small problems with one swift stroke. I feel confident enough to use it on a live site myself...
Comment #3
deekayen commentedComment #4
lanesharon commentedI would like to test this through. My original (from 4.7 module page) does not look like the original your referenced above. Can you send me the 'new' module with all the changes? Then I can install and test it on my system and let you know if I run into any snags.
Comment #5
deekayen commentedI've tried the patch, and it does seem to make things better, but I want to make some additional changes if I'm going to be the one to apply it to CVS. The whole use of the referrer and flood cookie implementation breaks things for me if I load one page, then load another then try to email the first. I've started on an alternate implementation using $_SESSION and arg(), but it doesn't really apply to this bug report.
Comment #6
lanesharon commentedIf you want any help testing, let me know. Please give me a 'heads up' when you load it to cvs.
Comment #7
zoo33 commenteddeekayen, I've hade similar problem as you, but I decided to ignore them until this patch was done. But I guess we're past the stage of doing things step by step (I know, I started it). Looking forward to your improvements.
However, I've found a serious bug with the current implementation. It's the code that is executed in the global scope at the top of the file. It seems harmless because there's just a couple of constants being assigned, but the calls to t() cause a lot of trouble. Those calls are executed before the $locale variable has been set, which breaks locale's caching mechanism and cuts the performance of the site drastically. It's quite bad actually.
So I moved those constant assignments to emailpage_menu() instead. (I think that hook is often used for code that a module needs to run on every page load.)
My modified version of the module is attached. (Let me know if you need a new patch.)
Comment #8
deekayen commentedI handed the bit of work I've done over to AjK, but I'll still get updates to commit changes to CVS if they're posted here.
Comment #9
AjK commentedAs deekayen says, I've taken over this bit of work.
Attached to this is a brand new version of emailpage.module It's sent in full as it's pretty much so different from the original a patch was really not an option.
I've tested this module on 3 different platforms and all appears well but it needs testing and feedback from the community.
This new version addresses a number of previous issues, in particular, where the user is sent after the email goes. In this version, the user is sent back to the original node and a message is added noting that the email went.
Another major point is the number of options in "admin >> settings >> emailpage". There are alot more settings (remember aswell that in control access a user needs admin perm in order to get to the admin page).
Looking forward to feedback,
best regards
AjK
Comment #10
AjK commentedNote, when saving the file above, please ensure you save it as "emailpage.module" and not "emailpage_2.module" as it's stored here as
regards
AjK
Comment #11
lanesharon commented4.7
Story, Blog, Page: Doesn't work for URL-aliased links -> 'Email this story' link uses original node number, so you get sent to a 'page not found' error.
Newsletter, Forum, Polls: No 'email this...' link shows up at all for URL aliased entries or node numbered entries.
Sorry!
Take Care, Sharon
Comment #12
zoo33 commentedI looked through the code quickly. No time to test in now, but I will. It looks great! I like the new mechanism for default values.
A few comments:
Line 99 & 153: Should '
' be there? Other return statements in the same function don't have that. And if so, maybe we should use
return '</p>' . t('string');instead?Line 108: The variable $local_nid should be moved so that it doesn't generate multiple instances of the locale string:
t('Supplied node nid number invalid: %nid', array('%nid' => $local_nid))And maybe it should read 'Supplied node id...' instead, nid is short for 'node id' right?
Line 153: Same thing as 108.
Line 290: Same thing again. variable_get() should be moved out of the locale string.
lanesharon's problems with path aliases are probably due to some paths in the code that aren't passed through the proper functions, such as url(). I'm not that well acquainted with those functions, so I'd have to do some research before I can help out with that.
Comment #13
zoo33 commentedSorry, I messed up. It should read:
Line 99 & 153: Should
</p>be there?Comment #14
AjK commentedThanks for the feedback,
lanesharon, I have to plead some ignorence here, can you give me a sample of a "URL-aliased links" please so I can break it down and look further.
zoo33, thx for the comments, I'll take a look at this shortly.
regards
AjK
Comment #15
lanesharon commentedI did everything wrong. I had the wrong CVS version. I got the patched one from here today. I removed the old module and unhooked it. Then I:
Went into admin -> modules and clicked on the emailpage 'Enabled' box.
Then, admin -> access control and set up 'all registered users' to access for email page and admin to 'administer'. Then went to admin -> settings -> emailpage and reset the checkmarks in there.
Works like a charm!
In the email it gives the link as domain/node# instead of the domain/url-alias, but that is okay. As long as the link gets mailed out. Thank you very much for the enhancements.
Comment #16
AjK commentedRe-write so, have started new issue as I believe all the above has been addressed.
Please see http://drupal.org/node/63624 to follow up
regards
AjK