Project Description:
Provides a very simple Ajax-Based user interface (Block) from where users can calculate their age.
User Interface:
1) A block named 'Age Calculator' consisting age evaluation fields is created in hidden mode. Which can be enabled to any region from blocks listing page for any desired theme.
2) For administrators: A separate User interface is provided under configuration>people>age calculator page.
The Age-calculator block output format can be controlled from here.
Following formats are supported for now.
- Y years M months D days
- M months D days
- W Weeks D days
- D days
- H hours (Approximate)
- M minutes (Approximate)
- S seconds (Approximate)
Dependencies: None.
Project Sandbox Link: https://www.drupal.org/sandbox/kunal.kursija/2452777
Git Clone Command: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/kunal.kursija/2452777.git age_calculator
Manual reviews of other projects:
https://www.drupal.org/node/2452925#comment-9731107
https://www.drupal.org/node/2453657#comment-9734829
https://www.drupal.org/node/2455723#comment-9738995
https://www.drupal.org/node/2457159#comment-9748583
https://www.drupal.org/node/2402633#comment-9749533
https://www.drupal.org/node/2457761#comment-9750817
Comment | File | Size | Author |
---|---|---|---|
Admin Settings.png | 63.13 KB | kunalkursija | |
Age Calculator.png | 21.58 KB | kunalkursija | |
Age Calculator UI.png | 17.75 KB | kunalkursija |
Comments
Comment #1
PA robot CreditAttribution: PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxkunalkursija2452777git
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.
Comment #2
guptas89 CreditAttribution: guptas89 commentedHello
Please find my review below:
age_calculator.install
You don't need to set variables on age_calculator_install() functions, Instead wherever you are using variable_get() you can pass default value as a second parameter. e.g for 'age_calculator_years_months_days' you can use variable_get('age_calculator_years_months_days', 'age_calculator_years_months_days'). @see: https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/vari...
age_calculator.module
Use sanitize functions. Use t() function for form #title property for multilingual in line#81,88....
In age_calculator_permission()
'warning' => t('Warning: Give to trusted roles only; this permission has security implications.'),
What type of security implications this permission has?
age_calculator.settings.inc
In age_calculator_output_options() all the options value(strings) should be sanitize with t().
In age_calculator_default_output_options() use default value in variable_get(), once you removed variable_set in hook_install.
age_calculator.helper_functions.inc
In age_calculator_get_results() all the strings should be sanitize with t() like 'Your age is' in "<span class=''age_calculator_helper_text>Your age is </span>".
Comment #3
shipra.wasson CreditAttribution: shipra.wasson commentedHi Kunal,
The git clone command that you have mentioned is asking for a password.
Comment #4
kunalkursija CreditAttribution: kunalkursija commented@guptas89: "I will correct the strings and update here".
@Shipra:
This was my first full project application so i just made a mistake in clone URl.
Below is the updated url.
CLONE AGE CALCULATOR
Kindly let me know your review.
Thank you for taking your time out and reviewing the code.
Comment #5
guptas89 CreditAttribution: guptas89 commentedHi ,
I tried to clone this on my local machine with your updated URL mentioned in comment#4
Issue:
siddharth@siddharth:~$ git clone git.drupal.org/sandbox/kunal.kursija/2452777.git age_calculator
fatal: repository 'git.drupal.org/sandbox/kunal.kursija/2452777.git' does not exist
Instructions:
You can find the correct git clone command for your sandbox by clicking on the Version control tab, removing the checkbox in front of "Maintainer", and clicking Show. You can then copy-paste the git clone command from the codeblock below "Setting up repository for the first time".
Reference : https://www.drupal.org/node/1011698.
Comment #6
kunalkursija CreditAttribution: kunalkursija commented@guptas89:
1) Have resolved the translations and run coder module (No issues found).
2) Pareview generates zero issues.
3) About the Variable_set in hook_install(): This is optional, and the second parameter in variable_get which is $default has definition as
"The default value to use if this variable has never been set." .
So hook_install is optional since drupal does the job for me. But i will stick with hook_install for now :)
4) GIT CLONE : Pardon for this one, as i said i am new to contribution :)
After removing the maintainer checkbox, i see that author name is removed from git URl.
So below is the URL that is defined
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/kunal.kursija/2452777.git age_calculator
Thank you for all your time !
Comment #7
kunalkursija CreditAttribution: kunalkursija commentedHello,
I have updated the clone url and corrected pareview issues too.
Below is the updated git clone url.
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/kunal.kursija/2452777.git age_calculator
Comment #8
kunalkursija CreditAttribution: kunalkursija commentedComment #9
kunalkursija CreditAttribution: kunalkursija commentedComment #10
guptas89 CreditAttribution: guptas89 commentedWhen I select 'Age on date' < 'Date of birth' it shows error message:
"Invalid date of birth."
Error message should be change, something like: 'Age on date should not be lesser than date of birth'.
Comment #11
klausiThat sounds like a minor improvement but not like an application blocker, anything else that you found or should this be RTBC instead?
Comment #12
nesta_ CreditAttribution: nesta_ commentedHi! :) Good job :)
Fix in age_calculator.module Line 40.
$items['admin/config/people/age-calculator/settings'] = array(
40 'title' => 'Age calculator',
41 'description' => '',
Line 40 add function t()
Comment #13
guptas89 CreditAttribution: guptas89 commentedYes @klausi
For now I did not find any kind of blocker.
Manual Review:
Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
Looks good to me
Just one error message improvement:
Remove full stop from "Select age calculator output format. field is required." error message after 'output format.'
Comment #14
guptas89 CreditAttribution: guptas89 commentedHi @nguerrero
In D7 you should NOT be using t() in your menu declarations. Menu automatically pushes title and description through t().
@see: https://api.drupal.org/comment/51103#comment-51103
Comment #15
kunalkursija CreditAttribution: kunalkursija commentedHi Siddarth,
Improvement: I have fixed the "full stop" issue. Kindly check.
Comment #16
nesta_ CreditAttribution: nesta_ commentedYes @guptas89, @Klausi write me for the same. Sorry.
Comment #17
klausiRemoved review comments where you just posted the output of an automated review tool. Make sure to read through the source code of the other projects, as requested on the review bonus page.
Comment #18
klausimanual review:
Although you should definitely fix those issues they are not critical application blockers, otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to heddn as he might have time to take a final look at this.
Comment #19
kunalkursija CreditAttribution: kunalkursija commentedComment #20
kunalkursija CreditAttribution: kunalkursija commentedHello Klauss,
I have resolved the outstanding issues and made the necessary in repository. below mentioned is the status of some issues raised by you
By the way i have added "#after_build" because i am using '#type' => 'date' for date input, And there is no #options field to it during form definition.
these #options are not available in form_alters too. Which is the reason #after_build is used.
P.S : Birthdate cannot be a future year, so we have made only past years available by using #after_build (Altering #options).
Thanks for your detailed review and your time. Kindly let me know if any more changes are required or you have any suggestions to enhance this application.
Comment #21
kunalkursija CreditAttribution: kunalkursija commentedComment #22
kunalkursija CreditAttribution: kunalkursija commentedAdding PAReview: review bonus tag.
Comment #23
heddn// Comment here
instead of
The first two items should probably be fixed before a full release. The last just makes it a little more difficult for folks to contribute patches and improvements to the project. It doesn't need to be changed, but keeping the entry point low is always good.
Thanks for your contribution, Kunal!
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.
Comment #24
kunalkursija CreditAttribution: kunalkursija commented@heddn,
Thanks for your detailed review.
1) I have corrected the comments.
2) I have never used hook_theme() actually. So i will implement the same and update here.
3) I actually wanted code readability to be good, which is the reason i have seperated helper_functions, blocks, and menus-permissions via different files.
@klausi, @guptas89, @shipra, @nguerrero:
Thank you for your reviews !
it was fun working in a very well settled review process and i also learned some things from here, which i definetly did not knew before the contribution process.
For example : using placeholders in strings and about sanitization functions + Drupal translations.
ONLY ONE THING PENDING
i google'd around but all i got was that i will have to create a custom TPL file to use hook_theme(). (I am not sure if this is what u meant @heddn)
@heddn : Can you please share any usefull link which will help me in my hook_theme() implementation. i would be really thankful.
Comment #25
heddnI recommend using tpl when possible. It is more clear for folks to override later. However, you can also use a function instead of a tpl.
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
See the difference between 'function' & 'template'?
Also some blog posts that came to the top in google:
http://www.nicklewis.org/drupal-hackers-cookbook/theming/hook_theme-and-...
http://www.stephanemartinw.com/articles/25-theme-drupal-hooks-templates-...
Comment #26
kunalkursija CreditAttribution: kunalkursija commented@heddn,
Thanks for the links and your reviews, i will try fixing hook_theme() now and will update.
Thank you for your help and reviews.
Comment #27
kunalkursija CreditAttribution: kunalkursija commentedHi Heddn,
I have imeplemented the hook_theme() to generate html markup.
Can you please verify if this is correct ?
Comment #28
heddnIt looks about right. Does it work?
Comment #29
kunalkursija CreditAttribution: kunalkursija commentedHi Heddn.
yes it worked. Thanks for hook_theme. This was new for me :)