Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
5 May 2013 at 16:21 UTC
Updated:
16 Aug 2013 at 15:21 UTC
git clone --branch 7.x-1.x sergey-serov@git.drupal.org:sandbox/sergey-serov/1986160.git popup_announcement
cd popup_announcementThe module provides a pop-up announcement in the pretty colorbox overlay which will appear for the site visitor on the first, second and fifth visit to the site (customable). If interval between http requests is more than one hour, these are two different visits.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot from 2013-05-03 19:00:43.png | 407.68 KB | sergey-serov |
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxsergey-serov1986160git
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
linwiz commentedIn addition to comment #1, you're using the master branch. You should switch to a version specific branch, see http://drupal.org/empty-git-master. You also need to add the git clone command to your summary.
Comment #3
sergey-serovComment #4
rafalenden commentedHi Sergey, instead of using hardcoded HTML in function
popup_announcement_create_announcement()you should use theme function providing possibility to override it or at least attach JS as Drupal behavior.It's also possible using theme functions in JS files, http://drupal.org/node/171213.
Comment #5
rafalenden commentedComment #6
Dalay commentedHi, Sergey.
file popup_announcement.install:
Comment #7
geraldmelendez commentedSince the major code problems have been pointed out I'll focus on documentation.
Clarify the following in the Read Me file and on the project page:
In the configuration form replace
Number of visits when announcement will be appearwith
Number of visits when announcement will appear.Only numbers separate by ,with
Only numbers separate by commas.My humble opinion:
I feel that this functionality should be implemented on the client side rather than querying the database. For example, a js script can check a visit count cookie and activate the welcome message, such as I did here: http://www.duckydeals.com
Comment #8
sergey-serovrafal.enden, Dalay, geraldmelendez - thank you for your attention.
I added theme functions in module and index in schema, and made changes in docs.
Dalay, I decided to stay variable_set() in popup_announcement_install() because default values will be good in configure form (so will be access only after editing this form) - so in other function it is possible use variable_get() without default value every time.
Comment #9
k3vin_nl commentedI didn't find any technical issues with your module. But I do think it would be much more user friendly it the popup message could be edited in a text editor, instead of just plain text.
Comment #10
sergey-serovK3vin, thank you for a good idea!
Comment #11
federiko_ commentedGood module.
I installed it and configure it. I although tested theme function to change background and it worked well.
Here are some comments :
.install l.76 : "was requsted" >>> "requested"
.module :
Why do you use time() function and not Drupal constant REQUEST_TIME ?
(see https://drupal.org/node/190417#comment-6697632)
suggestion
- in module configuration form it would be great that if we let empty the field "Number of visits when announcement will appear" the pop-up appears at every visit.
Comment #12
sergey-serovfederiko_, thank you a lot for your attention.
I added this possibility to show announcement at every visit if corresponding field is empty. And made another your recommendations of course!
Comment #13
_timpatrick commentedHi Sergey-Serov:
Nice module - I can see this being quite useful.
An automatic code review of your module showed no errors.
Looking at your module manually:
popup_announcement.install
popup_announcement.module
Other than those two issues I can't see anything else of serious concern.
Comment #14
sergey-serovGood day, _timpatrick!
Thank you a lot for your review.
I made all your recommendation with cognitive benefit of themselves!
Comment #15
chrisfree commented[manual review]
I think this module has a some good use cases and I'd likely use it if I could get it working. Nice work, looking forward to clearing up how to get this running.
Comment #15.0
chrisfree commentedAdd command for git clone
Comment #16
sergey-serovDear chrisfree.
Thank you for your detailed review.
I made some editing in popup_announcement_create_block() and tested it.
One moment - if we leave field "Number of visits when announcement will appear" blank - announcement appear every one visit only one time. Not "to display on every page load". It will be very obtrusive.
It is not related with cache - there really stay *DRUPAL_NO_CACHE* in block properties. I corrected README.txt.
Comment #17
kscheirerIn popup_announcement.install instead of setting initial values for your variables, just provide a default when you call variable_get() in popup_announcement_block_configure(). You have that for the height and width, but you can do it for the other variables too. Also provide defaults in popup_announcement_create_block().
Instead of exploding strings like "1,2,5" to manage your settings, consider using a plain array with serialize() and unserialize() instead.
No major problems found.
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #18
mlncn commentedThanks for your contribution, sergey-serov!
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.
As noted by other reviewers, while it may be nicer from the developer perspective to set a variable and not have to include its default in variable_get(), variable_get() should always have a default. In theory one should be able to delete everything in the variables table and the site will still run on defaults, and in practice someone may delete some variables. So please remove the variable_set in install and stick defaults into variable_get(). This gets much nicer in Drupal 8!
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.
And thanks to the awesome reviewers: linwiz, rafal.enden, Dalay, geraldmelendez, K3vin, federiko_, chrisfree, _timpatrick, and kscheirer!
Comment #19.0
(not verified) commentedadd description of new feature