I created a module that allows users to add a race time field to their content types. Other date/time fields are specific to the time of day, while this one is specific to competitive times, which are measured in minutes, seconds and tenths, hundredths or thousandths of a second. The module creates a new field type that stores the time entered as an integer, first converting the time to a floating point time in seconds and then multiplies it by the number of decimal places to get a full integer. For example, a time of 1:25.58 is first converted to seconds (i.e. 85.58) and then multiplied by 100 to convert it to an integer (i.e. 8558).
There is an associated javascript file that formats the time when a user enters the value. For example, when s/he entered 12585, the javascript will convert it to 1:25.58 (adding the colon and decimal point).
I have a sandbox project set up located at https://drupal.org/sandbox/robbertv/2158841
The project repository is at git.drupal.org/sandbox/robbertv/2158841.git
This is the only project I've worked on for Drupal.org, but I have a Drupal based website with about 20 custom modules located at http://www.oregonswimming.org/. These modules are specific to Oregon Swimming, and don't belong on Drupal.
Reviews for this project
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | coder-results.txt | 1.55 KB | klausi |
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxrobbertv2158841git
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
robbertv commentedI have fixed the issues found with pareview.
Comment #3
robbertv commentedComment #4
abhishek-anand commentedHi,
You code is still on master branch, move it to 7.x-1.x. Read more at https://drupal.org/empty-git-master
format.js - has lines which is not terminated by ; (semicolon). Please correct formatting issues as per JavaScript coding standards. https://drupal.org/node/172169
format.js - Review the inline comments as per Doxygen formatting conventions. Exceeds 80 chars (http://drupal.org/node/1354)
Comment #5
abhishek-anand commentedComment #6
robbertv commentedI have corrected the issues with format.js and set 7.x-1.x to be the default branch. I cannot delete the master branch and I'm guessing it's because I don't have permission to do so.
Comment #7
robbertv commentedComment #8
abhishek-anand commentedGo to your module page >> Edit >> Default branch and set 7.x as your default branch. Then you will be able to delete the master branch by $git push origin :master
Comment #9
m1n0 commentedComment #10
robbertv commentedThe branch has been deleted and the javascript file has been updated.
Comment #11
michel_v commentedHi
Thanks for your contribution, I've reviewed your module and have found the following minor issues:
1. racetime_validate($element)
function doesn't actually do anything?
2. racetime.module line 362
missed the d of formatted
As a note, I found it a bit confusing that the field type added is called Time, perhaps it should be called Race Time, as per the module name.
Also I was expecting it to appear as a widget for Date, rather than it's own field type..
Thank you
Michel
Comment #12
robbertv commentedThank you for your feedback. I've fixed the typos and removed the unused function. It was there for future development.
This project is unrelated to anything that a Date field can deliver since the times are carried out up to the thousandths of a second, which date cannot do. Also, times are stored as an integer due to the fact that fractions of a second are used.
Comment #13
arlina commentedHi robbertv,
I agree with michel_v that the field type should be called as the module name. I also found the following issues when reviewing your module:
racetime_field_widget_form():$widget['#description']currently reads "Add description here". Please change it to a useful message that instructs users the correct format the input should have, like the number of decimals expected. Could be something like: "Enter time in 00:00.00 format" or "123456 will be interpreted as 12:34.56".input => parsed1or1. => .11.0 => .101.00 => 10:1.00I know I can just type "000100" to be parsed as "00:01.00", but it just doesn't feel as natural, and it would be a great UI improvement if you could take this into account.
Cheers!
Comment #14
arlina commentedComment #15
robbertv commentedComment #16
robbertv commentedComment #17
robbertv commentedThank you for the feedback. I have changed the field type and fixed the bug in format.js
Comment #18
jmaerckaert commentedI tested your module and it works as expected.
Comment #19
robbertv commentedHow long does it take to approve a project? It's been 3 months since I submitted and 2 since anything has been added.
Comment #20
izus commentedhi,
i read the code and here are ny notes :
- in hook_field_schema
'time' => array(can we please name the column 'racetime' as the providing module name ?- in the .module file
1)
racetime_field_widget_form(& $form, &$form_state, $field, $instance, $langcode, $items, $delta, $element)there shouldn't be a space between
&and$form.2)
isset ($items[$delta]['time'])should beisset($items[$delta]['time'])(no space after the function name)-in _racetime_add_js
Same space issues :
1)
& drupal_static(__FUNCTION__);=>&drupal_static(__FUNCTION__);2)
!empty ($racetime_js_added)=>!empty($racetime_js_added)Actually, i'm not sure what
_racetime_add_js()is for. as it returns nothing, i don't see how the drupal_static will be used. i guess the need is to add the js file only once in the page call, this is already the case withdrupal_add_jsfor files, it adds them once.-about the js file
We need to have a Js Drupal behavior for this : https://drupal.org/node/304258#drupal-behaviors
Thanks
Comment #21
robbertv commentedI've made a couple of the coding changes. However, I do not see the need to change the column name. Many columns use value or value2. Also _racetime_add_js() adds the JS file needed to format the entered time. It doesn't actually use the document.ready or other features as described in the drupal-behaviors link you provided.
Comment #22
robbertv commentedHi, just checking in to see if this will ever be approved.
Comment #23
klausiWe are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #24
robbertv commentedComment #25
robbertv commentedComment #26
robbertv commentedComment #27
robbertv commentedComment #28
robbertv commentedReview bonus completed. Hopefully, my project can now be approved.
Comment #29
klausiThank you for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found blocking problems with the project) or "reviewed & tested by the community" (you found no major flaws). Could you go back to those and set the status accordingly?
Review of the 7.x-1.x branch (commit e41333c):
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:
But otherwise looks good to me, setting to RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to er.pushpinderrana as he might have time to take a final look at this.
Comment #30
klausiOops, forgot attachment.
Comment #31
robbertv commentedI have fixed the issues found. Thanks for the feedback.
Comment #32
robbertv commentedComment #33
robbertv commentedComment #34
robbertv commentedComment #35
pushpinderchauhan commentedAutomated Review
Best practice issues identified by pareview.sh / drupalcs / coder. Yes, few below issues.
Review of the 7.x-1.x branch (commit c2238ab):
Manual Review
Project Page: Extend this little bit more, better to go through Tips for a great project page again.
(+) racetime.module:
<?PHPALLCAPS is a bad taste instead it should be<?php.I tested this module functionality and found for invalid time it shows
Invalid Timealert message but don't prevent the form submission. It should stop form submission with appropriate message for better user experience.The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Inline comments and docs looks good to me so...
Thanks for your contribution, robbertv!
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.