Project link: https://drupal.org/sandbox/uniwales/2100301
Git: git clone http://git.drupal.org/sandbox/uniwales/2100301.git

Reviews of other projects

Block Headline: https://drupal.org/node/2097475#comment-7914143
Twitter Embedded Timeline: https://drupal.org/node/2092233#comment-7914153
Drag & Drop Blocks: https://drupal.org/node/2095707#comment-7914127

Overview

Anonymous Date Reminder re-factors the Date Reminder module to allow anonymous visitors to request an email reminder to be sent at a specified time before an event. Generally these would be calendar events, but any node type that has any datetime field can support reminders.

Features

How this module differs from Date Reminder
This module does not integrate with Drupal's user system. It does not link reminders to users, it allows anonymous visitors to request reminders. In addition to the above change, this module:

  • Shows tabs only to users with the permission to view all reminders on a node.
  • Shows 'Send test email' only to users who can administer anonymous date reminders.
  • Allows reminder form to be displayed in a table and as unformatted fields
  • Creates a block that can be used to place the reminder form in a region using the block ui

Apart from the above, this module uses the code from and stays true to the original Date Reminder Module.

When reminders are enabled for a node, anonymous visitors can request reminders to be sent before each occurrence of the date/time. The visitor specifies how long before the date/time to send the reminder.

When reminders are enabled for a node type, anyone who can edit the node can enable or disable reminders for that node.

Reminders are sent using Drupal's email system.

System administrator can control:

  • Which node types allow reminders, and which date field (if there are several) in a type to use as the basis of reminders.
  • Which users can see or administer reminders.
  • Content of reminder messages.
  • If and how long reminders should be kept after last date occurrence.
  • The list of allowed lead times for reminders from which users can select.

Known Issues

  • If you use one of the administrator options to delete a group of reminders, there isn't any kind of "Are you sure you want to do that?" verification. There should be.
  • Reminders won't work well if the requested "lead time" is less than the cron period, especially less than half the cron period. If cron runs infrequently on your site you'll probably want to remove the options for short remind times.

Why Not Patch Date Reminder?

The changes necessary to make Date Reminder work for anonymous users required too many changes for a patch to be a reasonable solution. The maintainer for Date Reminder has not shown interest in allowing this functionality, possibly because of the amount of code that needed to be rewritten in order to allow for anonymous users. We tried to integrate anonymous reminders with the current user based reminders, but found that we needed to undo too much of the original to be able to produce something workable within our time constraints. Although, ideally, this would have been a collaboration, it was not possible. Although the basics of the module are very similar; the ability for anonymous users to request reminders seemed sufficiently different and valuable enough for us to warrant spending a little more time making this module releasable.

Coder Error

Coder highlights the following:

anon_datereminder.module

severity: normalreview: style_function_spacingLine 487: Functions should be called with no spaces between the function name and opening parentheses [style_function_spacing]
  $countemails = array_filter($reminders, function($reminder) use ($email) {

My callback function looks proper. I am not sure if coder does not have the appropriate rule in place to handle callback functions within function calls or if I am missing something.

Comments

batdesign’s picture

Issue summary: View changes

removing repeating overview field

batdesign’s picture

Issue summary: View changes

correcting repository link

batdesign’s picture

Issue summary: View changes

moving links to top of form

batdesign’s picture

Issue summary: View changes

changing branch to 7.x-1.x

bletch’s picture

Installed and tested on fresh Drupal 7, everything ran as expected. Automated tests picked up some problems with legacy code from Date Reminder I fixed and committed. Automated tests are now clear.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

fixing clone link

batdesign’s picture

Issue tags: +PAreview: review bonus

Requesting review bonus

batdesign’s picture

Issue summary: View changes

Adding reviewed projects section

willyk’s picture

I agree with your logic around the need for a new project as opposed to trying to build this into the Date Reminder module. Although perhaps the modules could perhaps eventually be integrated.

After running the module through Coder, it appears that a space should likely be added within the array on line 236 of anon_datereminder.admin.inc:

'#token_types' => array('anon_datereminder','node'),

If you remove that space it will eliminate the error generated by the Coder module.

Also note that on line 73 of mailer.inc, you should include enclose within a t() so that it is translatable by the [i18n_8] module:

drupal_set_message('email is required', 'error');

Line 73: The $message argument to drupal_set_message() should be enclosed within t() so that it is translatable. [i18n_8]
drupal_set_message('email is required', 'error');

I also suggest revising your ReadMe documentation slightly by expanding on the installation process and confirming that Date and Token are required modules.

batdesign’s picture

@willyk - Thank you for reviewing. Coder issues are fixed and readme is updated.

willyk’s picture

Did you see the other issue that arises when you run you module through the Code module? I'm wondering if perhaps there's a way to code this differently so that it doesn't raise a warning.

anon_datereminder.module

severity: normalreview: style_function_spacingLine 487: Functions should be called with no spaces between the function name and opening parentheses [style_function_spacing]
  $countemails = array_filter($reminders, function($reminder) use ($email) {

Also note that on line 299 & 300 the spacing/tabs need to be adjusted based on the report from the Coder module:

Line 299: Use an indent of 2 spaces, with no tabs [style_indent_spaces]
   && ($en != ANON_DATEREMINDER_TYPE_ON)
severity: minorreview: style_indent_spacesLine 300: Use an indent of 2 spaces, with no tabs [style_indent_spaces]
   && ($en != ANON_DATEREMINDER_TYPE_RETAIN)) {
batdesign’s picture

Hello,

Yeah, we run code cleanup automatically and it missed a few of the conversions. The last commit was clean using coder.

Thank you, again.

batdesign’s picture

Issue summary: View changes

editing Why not patch Date Reminder

batdesign’s picture

Issue summary: View changes

adding note for send test email change

jojototh’s picture

Hello, I found small coder issues in the latest version of code:

anon_datereminder_form.inc

severity: normalLine 257: Comments containing code should be removed for releases. [production_code]
    // date_timezone_set($dobj, $tz);

this one should be fixed.

There is also following two

anon_datereminder.module

severity: normalreview: style_function_spacingLine 523: Functions should be called with no spaces between the function name and opening parentheses [style_function_spacing]
  $countemails = array_filter($reminders, function($reminder) use ($email) {

db7.inc

severity: normalLine 149: Comments containing code should be removed for releases. [production_code]
 *   $reminders = _anon_datereminder_load_reminders(array('uid' => $uid));

but these are probably cause be strange syntax of anonymous function, and not recognized example tag.

And also I would prefer to have all hooks in module file to be on the top of file, and the custom functions on the bottom.
Otherwise it looks fine.

peter.milan’s picture

Status: Needs review » Needs work
peter.milan’s picture

Status: Needs work » Needs review

Sorry, for mistake.

jojototh’s picture

Status: Needs review » Needs work

Changing status.

jojototh’s picture

Issue summary: View changes

coder highlighting callback function note

candotri’s picture

This is really minor but could you please put the full git clone command into your issue summary? I didn't know the name of your module so when I git cloned it I had to figure it out. It just makes the project two steps easier to review. Thanks!
git clone http://git.drupal.org/sandbox/uniwales/2100301.git anon_datereminder
A direct link to your pareview.sh results would also help:
http://pareview.sh/pareview/httpgitdrupalorgsandboxuniwales2100301git

Your README.txt is well written and easy to follow. Good work.
You use constants far more than I typically see in Drupal modules. I don't see anything wrong with that but it sure sticks out!

It seems that you could reduce the size of your .module file even more by moving some of the functions out. I'm thinking of some of those internal functions.

Has this been tested with sites using MIMEmail and other such modules? That's quite common.

The code is readable and seems logical. The documentation is logical and easy to understand.

Good work!

Candotri

batdesign’s picture

Issue summary: View changes
batdesign’s picture

Status: Needs work » Reviewed & tested by the community
batdesign’s picture

Have updated the issue to reviewed and tested as the only issue is coder's incorrect error. Please let me know if there are any code problems that would keep this from being accepted.

klausi’s picture

Status: Reviewed & tested by the community » Needs review

please don't RTBC your own issues, see the project application workflow: https://drupal.org/node/532400

xiukun.zhou’s picture

Status: Needs review » Needs work

great work.
There are only two small problems
1. Your GIT file tree should not contain .DS_Store file http://drupalcode.org/sandbox/uniwales/2100301.git/tree
2. Why is two % in Hook_uninstall http://drupalcode.org/sandbox/uniwales/2100301.git/blob/HEAD:/anon_dater...

->condition('name', 'anon_datereminder%%', 'LIKE')),
sk2013’s picture

Nice Idea and Great Work. When this work will be available as a module for use?

Thanks,
Senthil

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

batdesign’s picture

Status: Closed (won't fix) » Needs review
klausi’s picture

Assigned: Unassigned » misc
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Review of the 7.x-1.x branch:

  • Remove all .DS_Store files from your repository.
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: /home/klausi/pareview_temp/includes/anon_datereminder_form.inc
    --------------------------------------------------------------------------------
    FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     43 | WARNING | The extra check_plain() is not necessary for placeholders, "@"
        |         | and "%" will automatically run check_plain()
    --------------------------------------------------------------------------------
    
  • Codespell has found some spelling errors in your code.
    ./anon_datereminder.module:10: occurance  ==> occurrence
    ./anon_datereminder.module:589: occurrance  ==> occurrence
    ./anon_datereminder.module:636: occurrance  ==> occurrence
    ./anon_datereminder.module:640: occurrance  ==> occurrence
    ./anon_datereminder.module:644: occurrance  ==> occurrence
    ./anon_datereminder.admin.inc:8: adminstrative  ==> administrative
    ./anon_datereminder.admin.inc:46: occurence  ==> occurrence
    ./includes/node.inc:61: occurance  ==> occurrence
    ./includes/node.inc:63: occurance  ==> occurrence
    ./includes/date.inc:89: occurance  ==> occurrence
    ./includes/date.inc:97: occurance  ==> occurrence
    ./includes/date.inc:107: occurance  ==> occurrence
    ./includes/date.inc:115: occurance  ==> occurrence
    ./includes/cron.inc:12: occurrance  ==> occurrence
    ./includes/anon_datereminder_form.inc:421: occurrances  ==> occurrences
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. anon_datereminder_menu(): why do you need the module_load_include() call for the admin.inc file here? You are noit calling a function from the file here?
  2. anon_datereminder_allowed_access_node(): global $user will always be set, so that if clause has no effect.
  3. anon_datereminder_nodeapi(): hook_nodeapi() does not exist in Drupal 7, so this function should be removed.
  4. anon_datereminder_node_type(): hook_node_type() does not exist in D7, so this function should be removed as well.
  5. "@param reminder $r": "reminder" is not a valid data type, see https://drupal.org/node/1354#types
  6. anon_datereminder_perm(): Again Drupal 6 code that should be removed. I have the feeling that you are mixing a D6 module and a D7 module here, which is a bad idea. This can lead to subtle bugs and the code is harder to understand for contributors. You should create a dedicated 6.x-1.x branch with D6 code only to keep that clearly separated.
  7. _anon_datereminder_get_node_enabled(): Do not use db_select() for simple static queries, use db_query() instead. See http://drupal.org/node/310075 . Also elsewhere.

Those are not critical application blockers, otherwise I would say this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to MiSc as he might have time to take a final look at this.

misc’s picture

After cleanup this is ready to go, as far as I can see.

sk2013’s picture

When this would be available as a module ? Looking forward at an early date.
Thanks

batdesign’s picture

I am going to implement the relevant parts of klausi's review this week.

batdesign’s picture

Latest push addresses all of the issues raised by Klausi. Please let me know if anything else needs to be corrected before this can be moved to a full on project.

Thanks.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

no objections for more than a week, so ...

Thanks for your contribution, batdesign!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

sk2013’s picture

Thanks batdesign for your good work on this module. I really appreciate this.

Thanks also to klausi for his untiring effort on the review process. People like you are an asset to the Open Source Community.

I am not a technical / Development resource and your dedication makes me to inspire and regret my inability to code or doing a code review. However, I can help in testing the functionality.

Klausi's guide on the review process will inspire many others.. I am sure.

Thanks again

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

toni.degroof’s picture

Since I got no answer on the forum I try to reach somebody here.
I can install date reminder and it works on my sie. I de-install Date Reminder and install Anonymous Date Reminder. I see no errors, but The fields don't show. I emptied the cache several times, tried a block, no result.
What am I doing wrong?