This module provides field wich can be displayed as timer/countdown. Module uses 2 jQuery plugins: County and jQuery Countdown.
This module allow to set an entity property as the target date (for example, properties 'created' and 'changed' of node entity). Also formatter of field have many options to configure the appearance of field.
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/sergei_brill/2040519.git field_timer
Reviews of other projects
https://drupal.org/node/2083831#comment-7836717
https://drupal.org/node/2070535#comment-7822397
https://drupal.org/node/2072377#comment-7833373
Comment | File | Size | Author |
---|---|---|---|
#29 | FORMAT_County.png | 61.2 KB | stockunlocks |
#29 | FORMAT_jQuery_Countdown.png | 38.79 KB | stockunlocks |
#24 | Article | test.home - Google Chrome_013.png | 63.95 KB | sergei_brill |
#23 | sergei-rev3.jpg | 19.31 KB | alexmoreno |
#22 | sergei-rev2.jpg | 19.72 KB | alexmoreno |
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/httpgitdrupalorgsandboxsergei_brill2040519git
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
sergei_brill CreditAttribution: sergei_brill commentedFixed.
Comment #3
balajidharmaI did a manual review of your module and my commends
In '#options' array you just use range() function. ( like range(0,7); )
Comment #4
sergei_brill CreditAttribution: sergei_brill commentedThanks for review.
Fixed.
Comment #5
chester_martin CreditAttribution: chester_martin commentedhi sergei,
I did a manual review of your module. Here's some thoughts:
General:
Seems like an exciting module and I can see some use cases right away. Great with the API possibility to define new entity timestamps.
Code
Loos neat and tidy. Pareview (http://pareview.sh/pareview/httpgitdrupalorgsandboxsergeibrill2040519git) gave 1 error: unused variable $name.
In .info file you probably don't need to state fields as dependency since drupal requires it.
Installation & configuration
Worked like expected. README.txt gives guidance.
Display
I can't get the javascript-files to load. I've downloaded them and put them in the stated folders in the libraries folder. Is it just me or does someone else have this problem?
Comment #6
sergei_brill CreditAttribution: sergei_brill commentedThanks for review chester_martin.
What do you mean? How can I reproduce the problem?
Comment #7
chester_martin CreditAttribution: chester_martin commentedI don't know, really. I followed your instructions about downloading the javascript-files and putting them in the folders inside sites/all/libraries. But if no one else has this problem then it might just be my installation. I'll test with a different installation and report back to you.
Comment #8
trrroy CreditAttribution: trrroy commentedEverything worked for me except one field display option. If I change the Display Format to "County" then I see all zeros on the page and there's a javascript error "Uncaught TypeError: Object #
has no method 'countdown' field_timer.js?25" Another item that I noticed is that the name of the module seems to be field_timer but on the Modules page it is shown as Timer Field. It would be helpful to have them be the same. Thanks! I'm looking forward to using this module.Comment #9
sergei_brill CreditAttribution: sergei_brill commentedto chester_martin:
thx, I fixed some issues.
to trrroy:
thanks for reveiw.
County do not provides timers, only countdown. So, if time is passed, it displays zeros.
fixed
Comment #10
sergei_brill CreditAttribution: sergei_brill commentedadded PAReview: review bonus tag
Comment #11
artem_sylchukComment #12
sergei_brill CreditAttribution: sergei_brill commentedThanks for review.
1. My module use 2 other jquery plugins to display countdown/timer. My module provides some option to customize the countdown/timer. Unlike the field_countdown, field_timer can display both countdown and timer (if jquery plugin supports this feature). Any date from entity can be used as end date for countdown or as start date for timer. If user wants just install and use countdown, he can use field_countdown. If user needs timer, if he wants to customize timer or countdown, he should use field_timer.
2-5 fixed.
Comment #13
alexmoreno CreditAttribution: alexmoreno commentedHi Sergei,
looks perfectly fine with me, but I think you have to add in your module description a "Similar modules" section, and paste this explanation.
Thank you.
Comment #14
alexmoreno CreditAttribution: alexmoreno commentedIt's a minor/silly thing, but the link in the git clone is wrong. It should be:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/sergei_brill/2040519.git field_timer
I installed the dependencies (date and library) and proceeded with the module installation. Both, county and jquery.countdown.
Once done, i created a new field in an article content type, and added a new content. The field is displayed, but not as a clock timer, I do not know if this is right or if I should modify something in my templates:
I think the documentation should clarify adding as point 4: "Add a new field in your desire content type."
Thanks for your effort with this module Sergei.
Comment #15
alexmoreno CreditAttribution: alexmoreno commentedComment #15.0
alexmoreno CreditAttribution: alexmoreno commentedAdded review list
Comment #16
sergei_brill CreditAttribution: sergei_brill commentedThanks for review.
The module provides 3 formatters for the field - simple text (default formatter), County and jQuery Countdown. Since libraries are not required, default formatter is simple text. I'll add detailed description about this thing
Comment #17
alexmoreno CreditAttribution: alexmoreno commentedBut, where do I select/change this? In the content type?
Comment #18
sergei_brill CreditAttribution: sergei_brill commentedadmin/structure/types/manage/article/display
Comment #19
alexmoreno CreditAttribution: alexmoreno commentedok, I have selected the Countdown and what I get is :
timerfield:
1 day 3 hours
but no js or countdown itself. I have probably done something wrong, but it looks like the libraries not being loaded. In fact:
are not being loaded, as they are not the 3rd party libraries:
After clearing the cache, just in case, nothing changed.
I attach screenshot if it helps.
Thank you Sergei
Comment #20
sergei_brill CreditAttribution: sergei_brill commentedI just tested the module on a clean drupal installation. And it works fine for me.
Are you sure you changed the formatter? On the screenshot is 'Text' formatter.
Check libraries folder. May be drupal has no permissions to access the library.
Thank you urwen
Comment #21
alexmoreno CreditAttribution: alexmoreno commentedthis is what I have Sergei, have a look. Are you sure I don't have to add anything? Simply adding the libraries the field theme should change?
Comment #22
alexmoreno CreditAttribution: alexmoreno commentedsecond screenshot
Comment #23
alexmoreno CreditAttribution: alexmoreno commentedand third one
Comment #24
sergei_brill CreditAttribution: sergei_brill commentedNo, it should not. You have to change the field formatter. On the first screenshot change 'Text' to 'County' or 'jQuery Countdown'. Than the field will be displayed as you expect.
Comment #25
alexmoreno CreditAttribution: alexmoreno commentedI have not this option Sergei, it just displays text, when I click in format :-(. Permissions maybe?
Comment #26
sergei_brill CreditAttribution: sergei_brill commentedyes, may be. Check paths and permissions for libraries directories.
Comment #27
alexmoreno CreditAttribution: alexmoreno commentedneeds review
Comment #28
alexmoreno CreditAttribution: alexmoreno commentedsorry, wrong place :-(
Comment #29
stockunlocks CreditAttribution: stockunlocks commentedHello sergei,
When installing the "Timer Field" module, I started with a basic Drupal installation configured for another module that I was testing. However, when going to enable your module, I noticed that it Requires: Libraries and Date_popup (Date) when viewing from /admin/modules.
Yeah, I know, most people already have these installed. I just happened to not need them for what I was doing at the time.
It's true that these are dependencies in field_timer.info, thus the reason for the requirement showing up as noted above.
Just as a suggestion, maybe you can include a "REQUIREMENTS" section in your README.txt which indicates these additional modules.
It might also be useful to include a link to these required modules on your project page as well.
As stated in the "Module documentation guidelines" (https://drupal.org/node/161085)
You may also reference "README files" at https://drupal.org/node/447604
Other than that, your other supplied instructions in the README.txt allowed me to install everything else just fine.
Adding the Timer Field to an existing Content type was straightforward.
For my installation, I went to /admin/structure/types/manage/product/display and made the FORMAT change to "County", saved and refreshed my content and all was good.
Made the next FORMAT change to "jQuery Countdown" and ditto, worked well.
Screenshots included below:
Thanks!
Comment #30
alexmoreno CreditAttribution: alexmoreno commentedok, so sorry. I have had some time to test it again, and i found my problem (silly me). I was placing the libraries foler in sites/libraries, instead of sites/all/libraries. Sorry Sergei :-(.
Some things about your code.
1. I would advice you to split your .module, adding a .inc file. The .module should only contain hooks, all the rest of functions should be in the inc file.
2. Functions like that one: field_timer_field_formatter_view
are too big, some people would say that it is not following coding standards if it is bigger than 30, 40 or 50 lines. You can probably split the functionality in several functions.
3. You are still having some minor issues in the pareview tool, no big deal anyway:
http://pareview.sh/pareview/httpgitdrupalorgsandboxsergeibrill2040519git
4. the .php function should be named using Drupal conventions: field_timer.api.inc, and I'd placed it with the other .inc which I advice you to create in a includes folder.
5. As you need to use third libraries, I would add a message in case that this libraries are not detected, so the user will see very quickly why something is not working (like it happen to myself).
6. Add some comments in the middle of your functions. It is good for third developers, but it is great for you too when you have to review your code months or years later.
Thank you for your effort Sergei.
Comment #31
klausihttps://drupal.org/project/field_countdown
This sounds like a feature that should live in the existing field_countdown project. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in the field_countdown issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.
If that fails for whatever reason please get back to us and set this back to "needs review".
Comment #32
klausiOops, just saw that you already explained differences to the existing module in #12. Please add that to your project page, so that users can make an educated choice between similar modules. And checkout https://drupal.org/node/997024 to improve your project page.
Comment #33
sergei_brill CreditAttribution: sergei_brill commentedto urwen
1. There is only 2 functions which are not hooks. I don't think it is better to move 100 line to another file. If it is requirement from a documentation, please, provide a link.
2. Yes, I know the function it too large. I plan to use theme hooks next version. I splitted the function for now.
3. Fixed.
4. I'm afraid you are wrong. See https://drupal.org/node/161085. The file is a part of documentation, it describe hooks provided by module, it doesn't provide any functionality.
5. The message was added (see _field_timer_county_formatter() for example). Since module can work without these libraries, I don't display any messages. If there is no a library, it just do not add related formatter. This feature allows admin to avoid installation of unneccessary libraries. For example, admin want to use only County and don't want to install jQuery Countdown. If I want to make the libraries required I should add hook_requirements.
6. I added some comments.
to darrellhenry and klausi
I changed README.txt and project page.
Thanks for review.
Comment #34
alexmoreno CreditAttribution: alexmoreno commentedThanks for your changes and explanations Sergei.
Comment #35
drupalfan79 CreditAttribution: drupalfan79 commentedI created a timer field with default value, when I add a node, it shows warning:
It works well without default value.
Comment #36
drupalfan79 CreditAttribution: drupalfan79 commentedComment #37
sergei_brill CreditAttribution: sergei_brill commentedThanks for review drupalfan79. The bug fixed.
Comment #38
drupalfan79 CreditAttribution: drupalfan79 commentedComment #39
kscheirerOn your project page "wich" should be "which".
Thanks for adding a "Similar Projects" section to your project page, can you describe the differences a little more? Why would a user choose your module instead of one of the others? Or which use cases does your module handle that the others don't.
Your module is named "Field Timer" but in the .info file it's named "Timer Field" - pick one :)
The module looks good though, and those don't seem like major problems.
Thanks for your contribution, sergei_brill!
I updated your account to let you 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 get 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.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #40
kscheirerComment #41.0
(not verified) CreditAttribution: commentedfix git link