Closed (fixed)
Project:
Simplenews
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
17 Jul 2005 at 09:26 UTC
Updated:
25 Sep 2005 at 17:50 UTC
Jump to comment: Most recent file
I did a quick code review. All of these are (extremely) MINOR points. Fix them as you please.
$sn_form .= strlen($email) <= 30 ? $email : substr($email, 0, 29).'...'; will fail when multi-byte UTF-8 characters are present. Remember we are always dealing with UTF-8 strings, not ASCII strings. Use truncate_utf8($mail, 29, FASLE, TRUE);. It's a Drupal function that lives in common.inc.$sn_form = form($sn_form, $method = 'post', ''); looks like a copy-past error. Probably should be $sn_form = form($sn_form).newsletterconfirm/remove/$subscription-id would be something like newsletter/confirm-remove/$subscription-id or newsletter/remove/$subscription-id. $message = t('Newsletter "%title" could not be sent to %email.', array('%title'=>check_plain($node->title), '%email'=>$mail->mail)); watchdog('simplenews', $message, WATCHDOG_ERROR);theme('placeholder', $foo) with watchdog() and drupal_set_message(). This ensures that messages are themed properly. theme('placeholder') calls check_plain() for you, and makes sure messages are themed properly/consistently.t('Newsletter subscription status confirmation notice for').' '.variable_get('simplenews_from_name', $name_default).' '.t('newsletter.'); is not easy to translate. Better to use a variable %newsletter-name so you don't have to break up the sentence. That gets you translation bonus points.drupal_set_message(t('No addresses were added.'),'status'); You can omit the 'status'. It's the default value.sn_time(). See timer_start(), timer_read() and timer_start().$GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER'] with referer_uri().
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | simplenews.patch | 50.13 KB | nathanwastaken |
Comments
Comment #1
nathanwastaken commentedI'm not the greatest coder, but I will work my way through these points, so that DriesK can get to work on more urgent issues.
This patch deals with point number 1. It is a VERY MINOR issue, but it will make it more useable for other developers who are interested in this modules development.
No more tabs in this code.
I am sorry I am going to get this done, patch by patch (and point by point), but I don't have the time (or the patience) to do them all in one hit. Just apply them in order, and there should be no problems.
Comment #2
nathanwastaken commentedSome work has come up, I will work on this, but... It may take a little longer. I will 'un-assign' myself.
Comment #3
nathanwastaken commentedand I forgot to...
Comment #4
DriesK commentedNathan, thanks for the effort anyway. I'm going to change simplenews.module in the next few weeks to enable subscription to multiple terms as discussed earlier (I'll try to do so during my holidays). This probably means that a lot of code has to change anyway, so when I encounter any of Dries' issues, I'll address them right away. If any of them remain, you can tune in again as you like. I'm leaving for France on Friday, and I don't think I'm going to have much of an internet connection, so you can expect to hear from me again in about two weeks.
As for the tabs: it's a funny thing. I always type 2 spaces, but apparently my editor automatically changes double spaces into tabs. I never realised that, but now I disabled this "feature" :-).
Comment #5
DriesK commentedComment #6
osherl commentedComment #7
(not verified) commentedComment #8
DriesK commentedClosed because the automatic close feature in project module is broken, and the issue list is becoming cluttered.