Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2013 at 00:26 UTC
Updated:
15 Aug 2013 at 13:41 UTC
Display Islamic prayer start times, prayer congregation times and funeral prayer times:
The bundled README.txt contains detailed information.
Sandbox: http://drupal.org/sandbox/munawar/1867970
Git: git clone http://git.drupal.org/sandbox/munawar/1867970.git prayers
Comments
Comment #1
PA robot commentedWe 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.
Comment #2
afi_amouzou commentedI install the module and the prayer page shows following errors:
Notice: Undefined offset: 0 in prayers_page() (line 106 of prayers/includes/prayers.pages.inc).
Warning: Invalid argument supplied for foreach() in prayers_page() (line 106 of prayers/includes/prayers.pages.inc).
Notice: Undefined offset: 0 in prayers_page() (line 114 of prayers/includes/prayers.pages.inc).
Warning: Invalid argument supplied for foreach() in prayers_page() (line 114 of prayers/includes/prayers.pages.inc).
Notice: Undefined offset: 1 in prayers_page() (line 114 of prayers/includes/prayers.pages.inc).
Warning: Invalid argument supplied for foreach() in prayers_page() (line 114 of prayers/includes/prayers.pages.inc).
Notice: Undefined offset: 2 in prayers_page() (line 114 of prayers/includes/prayers.pages.inc).
Warning: Invalid argument supplied for foreach() in prayers_page() (line 114 of prayers/includes/prayers.pages.inc).
You should scheck if $rows contains data before you loop over it.
Comment #3
munawar commentedAmouzou - thanks for letting me know. This notice only appears if the PHP error reporting is set to a higher level. However, I agree that null objects should be handled better - which I have now done.
Please note that the prayer page is only useful once prayer data has been imported. There are two files in the examples directory if you are interested in using them. One is comma separated and the other tab separated.
Comment #4
musicalvegan0 commentedVery nice README file. Very detailed.
You should consider changing the location of the "prayer" page. I can foresee that someone who would include this on their site may already have the /prayer URL in use. Consider something like: /prayer/prayertimes. It really doesn't matter so long as it has less chance of being in use already.
Other than that, looks good to me.
Comment #5
munawar commentedmusicalvegan - thanks for the advice. I have now changed its default path.
Comment #6
samvel commentedHi, my manual review:
main module:
function prayers_page($account = NULL, $set_title = FALSE)Have a nice day!
Comment #7
samvel commentedComment #8
munawar commentedasik: Thanks - that was very detailed. I have made the changes.
Comment #9
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxmunawar1867970git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #10
munawar commentedFormatting errors introduced by the previous code changes have now been fixed.
Comment #11
swim commentedHey Munawar,
Loving your use of whitespace & function descriptions, made it rather easy to read. Maybe not needing so much whitespace however, e.g. after returns. Mostly suggestions from me; I did find a few places where you could drupalize your code.
In prayers.module, line 367.
Your returning a javascript link, use http://api.drupal.org/api/drupal/includes!common.inc/function/l/7
As such,
In prayers.module, line 394 - 397.
I don't understand why you have a set number of dates/ year(s) 0 - 3.
Cheers,
Comment #12
swim commentedForgot to update status, I'm sorry.
Updated status to needs work.
Comment #13
munawar commentedHi hapax. Thanks for the tip - I have made the change.
The four dates represent the DST transition dates for this year and next year.
Comment #14
swim commentedNo problem =).
Now this is just a suggestion so I won't be changing the status. Would it be possible to represent the DST transition dates dynamically? This would allow for future proofing of your project.
Cheers,
Comment #15
munawar commentedhapax: there are two reasons that can't be done (good suggestion though):
Not all congregation times actually change on a DST change. Each module user will have their own rules.
The selection of the relevant congregation time for a particular day is based on a query finding which tuple in the database has a period start and end that the day lies between. Having the database start or end date set to a non-date string complicates that.
Comment #16
eriknewby commentedHey. Thanks for your contribution.
Looking at your code and enabling, here are two minor points I'd recommend.
1. prayers_install(): No need to set variables upon installation as you can make use of default values with variable_get() anyway.
2. prayer.info: would be great if you added a link to your configuration page. That provides convenience from the module page to quick link to the configuration of this module
Comment #17
munawar commentedHi Erik
Thanks for the second tip - I have implemented it. The first one can't be implemented because a module user may not want any text to appear at all, so I can't set it as the default text in variable_get(). I have merely bundled both strings in the .install file as a suggestion.
Comment #18
grandivory commentedmanual review:
I think this is very close to being ready, but there are a few things to work out first.
Comment #19
munawar commentedHi grandivory,
Thanks for the detailed review. I have implemented everything except the following:
EDIT 23 July: I have updated the feeds importers to the format used by Feeds 2.0 alpha 8.
Comment #20
kscheirerFirst off, great documentation and README file!
The date handling code is very complex, and I honestly don't really understand what you're calculating, but if it works then that's great :) I do see some areas where you could simplify though - check out php's strtotime() function - it's a much easier way of manipulating timestamps.
For ex,
$start_of_year_tstamp = time() - (60 * 60 * 24 * 365);is just an approximation, strototime() can calculate that exactly.Please remove the require_once at the top of your file though - that bare php code will be executed on every Drupal page load. Load files like that only where they are needed.
Otherwise this code looks decent, thanks!
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #21
mlncn commentedThanks for your contribution, Munawar!
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 on being a project maintainer:
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 all reviewers, including afi_amouzou, hapax legomenon, Samvel, musicalvegan0, eriknewby, grandivory, and kscheirer!