Module Name: Alert Message
my module generates an alert message to be displayed at the top of web pages that the user is viewing, so that site administrators can communicate important notifications to their user (Examples: Site maintenance, Weather Alerts, and Scheduled Events). Administrators can add, edit, and delete custom colors and (background color, border color, font color) for messages. They can also decide what messages appear on designated pages.
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/irodriguez/2172777.git
Comments
Comment #1
irodriguez commentedComment #2
irodriguez commentedComment #3
irodriguez commentedComment #4
freddybushboy commented1) Upon enabling this module I get the following errors:
I first thought this was because no messages have yet been set but I still get these messages even after adding some tests.
Even when not getting these errors I still get:
Notice: Undefined variable: messages in alert_message_process_html() (line 679 of /Users/freddybushboy/Sites/sandbox/sites/all/modules/custom/alert_message/alert_message.module).2) The module is missing a README.txt or README.md file
3) You should remove "version" from the alert_message.info file, it will be added by drupal.org packaging automatically.
4) Code sniffer has also found quite a few issues with your code in relation to Drupal standards - you can take a look here:
http://pareview.sh/pareview/httpgitdrupalorgsandboxirodriguez2172777git
In the link above there are some links to the documentation. Unless there's a good reason to not do it, you should fix all issues reported there. You can run http://pareview.sh/ as many times as you want
Comment #5
irodriguez commentedok I have run my code through the coder module and pareview.sh I have been able to fix all issues found except the error stating that I am missing a readme file. I placed a readme.txt in the main directory of the module and put some text in making sure each line doesn't exceed the 80 character limit but pareview.sh is still not able to see the readme.txt file yet. I will work that out. Thanks for testing the module. please test with new git pushed files.
Comment #6
freddybushboy commentedNo problem :-)
The errors are now fixed for me.
It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch.
Not sure why pareview is not picking up your readme file - it is possible it needs to be name in all caps. Try rename it to README.txt. Also sometimes things take a while to show up as fixed on pareview (changing over from the master branch is a good example of this).
Also, I think you should add a description to your main menu item in hook_menu - I don't believe this is a requirement necessarily but it would look better. Also, are you sure structure is the right section for this? I would maybe consider something less prominent like 'User Interface' or something. Again, up to you.
Comment #7
irodriguez commentedI spent some time last night and this morning reworking the code that displays the alert messages. This should have nailed any bugs found previously.
I am definitely willing to move the url structure around to give it a proper home. if there are user suggestions for sections i could house the admin interface in, I would appreciate the input.
I'll definitely spend some time today reading the git branch documentation that you posted.
I am going to completely remove and reapply the readme.txt file again and see if i can get a better result also.
Comment #8
irodriguez commentedI have moved over to a version branch on git and followed the instructions for making it the default branch. I am now error-free on pareview.sh http://pareview.sh/pareview/httpgitdrupalorgsandboxirodriguez2172777git
Comment #9
xqus commentedIf that fails for whatever reason please get back to us and set this back to "needs review".
Comment #10
irodriguez commentedThe Site Status Message module allows users to set a single alert message from admin/config/system/site-information. The colors seem to be hard coded so overriding the style sheet is needed in order to change the colors scheme. There is only one message able to be set and you cannot choose which page(s) to present the message on.
My Alert Message module allows users to set multiple alert messages in multiple colors that can be changed easily via a built-in user interface. The user has full control over which page(s) each individual message is displayed on, and can turn each individual message on/off.
Due to the feature differences I believe that they are not the same type of module. The output is similar but the feature list is very different.
Comment #11
irodriguez commentedComment #12
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 #13
zhuber commentedDuplication
I have to agree with xqus (https://drupal.org/comment/8373635#comment-8373635) on this one.
From your response it really sounds like these are all features that could be patched into the "Site Status Message", since your module really just adds more configuration and functionality over the other module.
It's also worth noting that the User Notifications module seems similar as well. It is actively seeking a co-maintainer. It integrates with rules and the messaging API, so I would take a look to see if you can integrate your changes to this module and help with the maintenance.
https://drupal.org/project/user_notifications
Comment #14
irodriguez commentedThis is not the same as the user notification module. Here's is a quote from their page as to the implementation of the module
While the Alert message module is a way to communicate to users of the site not on an individual basis, but a general message to inform all users of the site related issues, changes, and notifications that the admin(s) wish to send out.
I do not wish to maintain someone's module, at this time. I do foresee myself becoming more involved in the community down the line, if I can get by the initial hurdle of initiation into the community, presented to me here.
Comment #15
leon kessler commentedOther similar modules:
https://drupal.org/project/alerts
https://drupal.org/project/alert_box
Also
If you're replicating the block system's visibility settings, why not just use them? Your module could provide a block with the additional stylings/settings you've created, and you could have all the power of the block system for free.
Comment #16
xqus commentedHi,
Duplication and abandoned modules is a big problem for users updating. If there is a module that aims to do the same, but lacks functionality the best thing for the community would be to contribute to the existing module.
If you feel your module solves the problem in a fundamentally different way, or the existing module developer don't want to accept your contribution that's fine.
We are aware that his process can seem a bit.. difficult, but most of the guidelines are in place for a reason.
If you still feel your module belongs here, set it back to needs review, and I will try to review it soon!
Comment #17
irodriguez commentedI have personally worked on sites where the block system got extremely crowded. It got so crowded once that it could no longer accurately keep track of weights. I would like the users to be free from the block system so they can utilize the user interface fully (like lists of alert messages on the admin page).
I'm not against converting to blocks (maybe a check box that generates a block). But that might be something best saved for a future upgrade/update.
Comment #18
irodriguez commentedComment #19
leon kessler commentedPlease could you describe how this module differs from the other two I mentioned (or why collaboration wouldn't be suitable). They both look like they provide very similar functionality.
Also there are other solutions for the block admin page problem, such as the context module.
I'd like to reinstate what was said by xqus. Drupal is all about collaboration. It's great that you want to contribute, but it would be much more useful to the community if you can provide patches to existing modules rather than creating standalone new ones.
Please read https://drupal.org/node/23789.
Comment #20
irodriguez commentedAlright I have installed and tried the following two modules.
1. https://drupal.org/project/alerts
2. https://drupal.org/project/alert_box
1. The Alerts module hasn't been updated since November 1, 2011, it is still in the development stage. and I could not get it to display an alert message (I couldn't find the url to add a message via the menus).
2. The Alert Box module hasn't been updated since September 6, 2013, The Drupal 7 version of the module is still in the development stage, and the message that I input is not prominently displayed like on my module.
I do not wish to take on someone else's module project when I have already written, tested, and submitted my own module that comes with a nice, convenient list of features that have so far differentiated it from the other "alert" modules that I have installed and reviewed.
Comment #21
irodriguez commentedComment #22
irodriguez commentedI have included screenshots on the sandbox page to help illustrate the way this module works.
https://drupal.org/sandbox/irodriguez/2172777
Comment #23
irodriguez commentedComment #24
nitesh sethia commented@irodriguez
I have tested your module on pareview.sh and found 2 errors.
For detail check the link http://pareview.sh/pareview/httpgitdrupalorgsandboxirodriguez2172777git
Comment #25
irodriguez commented0 errors displayed for me. Can you please retest?
Comment #26
rmn commentedHi Ivan
Yes, it shows 2 errors on Pareview.
As per Drupal coding standards, each file should have an additional new line character at the end.
FILE: /var/www/drupal-7-pareview/pareview_temp/css/alert_message.css
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
57 | ERROR | Additional whitespace found at end of file
58 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------
Thanks
Raman
Comment #27
klausiMinor coding standard errors are not application blockers, please do a real manual review of the code.
Comment #28
irodriguez commentedI was unable to see the errors myself but I did apply and push the file alert_message.css with the newline so you should now see 0 errors (hopefully).
Comment #29
singhsantosh commentedHi,
I found some issues -
Documentation for the functions is not correct - You write 'Implements hook_title()' but the function is not a 'hook'.
In place of drupal_goto in 'hook_submit', you must use form_state['#redirect'].
If you want to render the html, you should use theme. 'alert_message_array_to_list' function is returning the HTML, you should make it a theme function and call it by using theme('xxx'). For this type of list you can use 'theme_item_list'.
Comment #30
singhsantosh commentedHi,
I found some issues -
Documentation for the functions is not correct - You write 'Implements hook_title()' but the function is not a 'hook'.
In place of drupal_goto in 'hook_submit', you must use form_state['#redirect'].
If you want to render the html, you should use theme. 'alert_message_array_to_list' function is returning the HTML, you should make it a theme function and call it by using theme('xxx'). For this type of list you can use 'theme_item_list'.
Comment #31
irodriguez commentedThank you kindly for the input. I have taken your advice and made the following changes:
1. I corrected the documentation/commenting concerning the _title functions. They now have a better description as to their functionality.
2. All of the hook_submit functions now have $form_state['redirect'] instead of drupal_goto()
3. I rewrote the function that generates the lists of messages. I am now using theme().
Thanks again for reviewing the module for me.
Comment #32
mister.koz commentedHey irodriguez,
Excellent idea, your code is very tidy!
Just a couple of things i noticed in the code:
alert_message_add_form($form, $form_state)and othersthe $form_state variable should be a reference e.g.
alert_message_add_form($form, &$form_state)(https://api.drupal.org/api/drupal/includes!form.inc/group/form_api/7)$form['name']and $form['settings']['pages'] don't have #title variables in them - this could well be by design, just pointing it out!Comment #33
irodriguez commentedThanks for the the look mister.koz I took your advice and changed to passing form_state by reference where applicable. The lack of a #title attribute on some of the form fields is indeed by design, I did not make any changes there. I plan to expand even further on commenting and the readme.txt file once I know more about the acceptable standards and once I feel more comfortable with commenting. I have been reviewing other modules, core and contributed, for commenting and coding examples so stay tuned for future updates in that department.
Comment #34
garethhallnz commentedJust wondering why hook_uninstall is not implemented to clear up the schema?
Comment #35
madhusudanmca commentedHi irodriguez,
First of all I would suggest you to add the link to git repo in the summary above to the appropriate git command to make it easier for reviewers i.e.
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/irodriguez/2172777.git alert_message.
Furthermore, could please explain how this module is different from "site_status_message" module, which also provides the similar functionality?
Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in the video_upload 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.
Thanks for your understanding.
Comment #36
irodriguez commentedComment #37
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.