Closed (fixed)
Project:
E-mail This Page
Version:
master
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
15 May 2006 at 08:59 UTC
Updated:
30 Nov 2006 at 19:45 UTC
Jump to comment: Most recent file
This follows on from http://drupal.org/node/62209 I have created a new issue as it's a rewrite of the module. This rewrite, I bleieve, addresses all the issues from #62209
The attached emailpage.module is an update on my previous version. It includes :-
zoo33's comments regarding non translation strings within t() functionsPlease test and report any issues regarding it here.
Regards
AjK
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | emailpage-module-060623b.patch | 1.24 KB | zoo33 |
| #21 | emailpage-module-060623.patch | 1.28 KB | zoo33 |
| #15 | emailpage_4.module | 16.18 KB | AjK |
| #12 | emailpage_3.module_patch_2 | 927 bytes | zoo33 |
| #9 | emailpage_3.module_patch_1 | 106 bytes | AjK |
Comments
Comment #1
deekayen commentedI know you were counting on me eventually commiting this to CVS, but as of today, I'm locked out. Only the lead maintainer can commit to projects now thanks to a new "feature".
Comment #2
deekayen commentedThat's an interesting urlfilter bug, but the feature link was http://lists.drupal.org/pipermail/development/2006-May/016096.html
Comment #3
AjK commenteddeekayen, I'll try and contact the maintainer regarding either a) getting him to commit when this is ready or b) taking it off his hands completely.
As for the urlfilter bug, I'm not sure how that relates to the emailpage work I'm doing / have done ??
regards
--AjK
Comment #4
deekayen commentedThe urlfilter bug doesn't. I just thought it was interesting that urlfilter stripped out the href of my a tag when it was in quotes for what was supposed to be a link for "feature".
Comment #5
zoo33 commentedI did another code review, without actually testing it... :)
I made a few changes and ran a diff (see attached patch) – thought it was easier than commenting on everything in detail. See what you think and use whatever changes you think are worthwile. Some things need explaining though I think:
1) There were no t() calls used for the strings in the default settings class. (Yes, I'm a bit obsessed with those...) The problem is, if we just add t() functions in the var declarations they will be executed much to early. So I added a constructor method which assigns the variables when the object is constructed.
2) I removed the
<center>tag because I think this is something that should be done with CSS for those who want it. I also changed the<b>tags to<strong>which is more compliant with xhtml. And i think that p tags have to have a separate start and end tag, so i changed<p/>to<br/>. (Maybe this chunk of html should have it's own theme function so that people can change it?)3) I added a form field for the sender's name which is only shown if the user isn't logged in. Otherwise the email would read "Sitename.com thought you'd like to see this" which could seem a bit unpersonal.
4) Then there is the URL that gets sent in the email and that the user gets redirected to after sending it. drupal_goto() does'n require you to deal with base_path, clean urls etc (I'm almost certain of it) so I removed those. And there is an url() function which you can use to build the URL in the email message. This will probably solve lanesharon's problems with path aliases not working.
5) In _emailpage_local_settings() I changed two variable names to make it easier to understand.
Then I have another issue which involves more work. Sounds fun? ;)
I think the form handling in _emailpage_main() is not all done in a preferred way according to Drupal's form api. I checked this page and I think you're actually not supposed to use $_POST explicitly, but rather through api functions. In this case, there should be an email_main_submit() function which recieves the submitted form data. Would you like take a look at that or do you want me to do it?
Comment #6
AjK commentedzoo33,
My thoughts....
1) Yes, I to am a bit of a t() hound, but I specifically left them out after the initial set-up simply because from that point on the site admin can change them him/her self. I assume they would use their native tongue to do that and therefore running them through t() wouldn't seem appropiate.
2) remove , yup, good idea, will take on-board.
3) With regard to adding info that ends up in email, I prefer "the minimum". The more you allow through the more you have to check for abuse/attacks. If a user is logged in, we have their actual user name which is what I'd prefer. But for Anon users' I don;t think it's a good idea to choose any arbitary name they like. So if the admin allows anon posting that's what I think the email should be, anon and not "pretend" to be someone. So, I'd rather leave this as is (I'm open to argument though, so please, comments).
4) url() OK, I'll look at this as it makes sense.
5) variable names: I'll look at this too. Anything that makes code clearer is a good thing, thx.
As for emailpage_main_submit() I'll follow your link and redo this. I'd obviously prefer to always use the recommended route in any API. Using $_POST was somewhat lazy of me following previous examples and not looking at the API in more details.
Thx for the comments, I expect I'll produce a patch soon.
Regards
--AjK
Comment #7
AjK commentedHere's the patch based on emailpage_3.module and zoo33's comments and my reply.
Regards
--AjK
Comment #8
zoo33 commented1) In my mind I see the case where someone installs the module and then immediately imports a translation. He/she would then perhaps expect everything to be translated. But I agree, it's not an important issue as the text can easily be changed.
3) Good point. If anonymous users should give any information, then maybe it's their validated e-mail address... Or maybe we should actually replace %someone with t('Someone') when the user is anonymous. That way it will be a person, 'someone', who recommends the page, not the web site itself.
Great, thanks for putting so much work into this.
Comment #9
AjK commented3) I like the idea of t('Someone') and the patch attached does this (after applying the previous patch).
Regards
--AjK
Comment #10
lanesharon commentedCan I assume that the suppression of 'access denied' will keep emailpage links from showing up in the my Google sitemap? Downloaded the lates (3) and seems to be chugging along. Thanks!
Comment #11
AjK commentedlanesharon, not entirely sure what you mean here. However, the way "suppress link" works is simple. If the link leads to a page that I know will give an "access denied" message if the user follows it then the link is omitted (suppressed) from the node. It's a "bug bear" of mine. I'm not keen on sites that give me lots of jucie looking interesting links only to find that clicking on them leads me to another page that says I have no access. If that's the case, why give me the link? (for flat html not alot you can do about that, but if it's within your power to "know" access will be denied then I think best behaviour is not to show the link).
Likewise, there is an admin setting "suppress link if flooded". If this is set on then we suppress the link if the user reaches the flood control limit. Flood control is still in action (for those that hand type in the URL) just again, don't see any point in displaying a disfunctional link if you know in advance that's the case. But that can be switched off. A site admin might link to continue displaying the link even if it leads to the warning message when flood control is reached.
Hope that helps
best regards
--AjK
Comment #12
zoo33 commentedWell, i tested it quickly and it seems to work as expected.
I came up with a few small changes though, see the attached patch.
Comment #13
AjK commentedzoo33,
Looks good, I'll make those amendments and resupply module. How much testing does these need before I approach the project maintainer about a commit?
fwiw, I have it running on several sites, one of which is busy and it's working a charm for me too :)
best regards
--AjK
Comment #14
zoo33 commentedI think it might be good to involve the maintainer sooner rather than later. No use testing this too much until we know if he'll want to rework something before commiting. Or maybe he'd like to give deekayen or you commit priviliges.
Comment #15
AjK commentedHere's the latest module taking into account zoo33's patch above.
I have used the drupal conract system to send a message to the project maintainer about where to go next with this issue
best regards
--AjK
Comment #16
zoo33 commentedShouldn't the title of the submission page be "email this page" and not "emailpage this page"?
Line 74 (in my copy at least):
'title' => t('email this page'),Any news?
If there is no reply, then perhaps send a message to the maintenance list and ask for advice. Maybe emailpage needs a new maintainer. peterjohnhartman doesn't seem to have been active on drupal.org for a couple of months.
Comment #17
AjK commentedZoo33,
Patch for that below. As for Peter Hartman, I've had an email from him
stating that he'd have a look this week.
best regards
--AjK
Comment #18
buddaWhat about adding the "display email link" as a setting on the
?q=admin/settings/content-typesnodetype pages?At least then all the node type specific settings are in one place.
Comment #19
buddaNew module seems much nicer, but i don't want user emailing pages to know the author of the node. That's why i turned off show post info in the theme settings. Maybe emailpage module could also respect these settings when deciding what to show on the
?q=emailpage/xxpage?Comment #20
zoo33 commentedGood points, budda. Especially the first one. The second one (showing or hiding author) could also be a setting in ?q=admin/settings/emailpage
Comment #21
zoo33 commentedAnother bug smashed.
The email validation was not working properly (try to send a page to an invalid address and you'll see for yourself). I moved it to a _validate() function which is the preferred way of doing it.
I also moved a variable assignment (
$name = $user->name;) to a more logical place. Oh, and the ?> at the end of the file should be omitted if I'm not misinformed.Comment #22
zoo33 commentedWell I don't know what happened with my last patch but there were two lines that shouldn't have been there. Try this one instead. If it doesn't apply, I'm sorry – please check the changes manually.
Comment #23
AjK commentedzoo33, looks good to me. But I'd love to know where you heard about ?> not being required at the end of a module? I've never heard of any php script that gets include_once()'ed without a closing ?> to match the opening <?php ?
best regards
--AjK
Comment #24
deekayen commentedLeaving off the ending bracket is legitimate. If you look at Drupal core files, most don't have the ending bracket anymore to prevent extra space from sneaking into the output and breaking HTTP header output.
Comment #25
zoo33 commentedI found it here:
Comment #26
zoo33 commentedWell, this module was downloaded 1122 times in June. It would certainly be nice if it was functional. Still no news on a commit? I sent an email to the maintainer, but I didn't get a reply.
Comment #27
buddaUse the 'forward' module - it works well in 4.7 and the author is active when committing patches to fix bugs :)
Comment #28
darren ohMarked issue 70342 as a duplicate of this issue.
Comment #29
darren ohThe Drupal 4.7 branch now uses the code from this issue.
Comment #30
darren ohBy the way, the fix was made in CVS commit 45506.
Comment #31
(not verified) commented