This module integrates into the Help module (using the hook_help() hook) to add help messages based on the URL. There is an administration form that allows users to set the messages and where they appear on the site. Multiple help messages can be added to the same page at once, the administration form can be ordered to sort the order that these messages appear.
There are a couple of similar modules on Drupal.org but they are appear to work in different ways and are all dead projects and have never received a full release. This module integrates directly with the Drupal help API and is designed to be as simple as possible, whilst still having a good feature set.
Project Page:
http://drupal.org/sandbox/philipnorton42/1193750
Comments
Comment #1
mikebell_ commentedHi,
Just a couple of notes:
- Use 2 spaces instead of 4 spaces per "tab" as per the drupal coding standards.
- Considering changing the tab name in the admin area to something short e.g. List. This also follows similar conventions that other drupal modules use. Same with add.
- Line 14 in hook_help.module looks unfinished
- Rather than defining your own submit button you can use "return system_settings_form($form);" instead.
Nice inclusion of a test file, my test setup is currently broken but will get it up and running soon. If you drop by #drupal-uk there are a few people who are willing to review as well.
Comment #2
philipnorton42 commentedThanks digital, I'll take a look at those notes and probably submit a new version.
Thanks for your time :)
Comment #3
joachim commentedSetting to needs work as per comments above. Please move back to needs review when you're ready for a reviewer to look at this.
Comment #4
philipnorton42 commentedRight, I have gone through and made the changes you suggested. Apart from the use of system_settings_form(). I just wasn't sure if it was the correct way to use this function here.
I have also added the ability to assign help messages to certain roles and added unit tests to test this functionality out.
Comment #5
klausiIt 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. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.
Comment #6
philipnorton42 commentedNeat. I didn't know Drupal.org had an automated coder review script, and it appeared that I was doing things a little wrong! :)
Anyway, I brushed up on git and figured out how to swap branches and things. I then passed everything through Coder to make sure everything passes to the strictest standards.
All test still pass as well so I haven't broken anything in making these changes.
Comment #7
klausiwrong branch name, 6.x-1.x-dev should be 6.x-1.x. And you should remove all contents from the master branch, step 5 in http://drupal.org/node/1127732
Comment #8
philipnorton42 commentedThis issue has now been corrected.
Comment #9
klausiReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.
manual review:
Comment #10
philipnorton42 commentedThanks for looking over this form me klausi, I really appreciate the time you have taken to review this. I have learnt a lot through this process (especially about using git properly).
Automated:
I think these are mostly to do with single instead of double spaces. I have corrected these issues and re-ran Coder to double check everything was ok.
Manual:
- I had removed the 6.x-1.x-dev branch locally, but hadn't pushed it. Sorted now.
- Added schema doc block..
- Removed the t() on db descriptions.
- Corrected this statement to use db_placeholders().
- Removed callback function and replaced with drupal_get_form.
- Overzealous filtering on my part. Removed the extra call to filter_xss().
- I had forgotten about the @ placeholder, thanks for the reminder :)
Comment #11
philipnorton42 commentedComment #12
beanluc commentedRegression since the above changes reveals new (or remaining) coding-style flaws:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Comment #13
beanluc commentedBesides that, may I suggest a different name for the module?
Because hook_help() is the name of a core hook, I believe that it would be very easy for there to be confusion. That name also does not really communicate what the module is for. Something like (just an idea) "Custom Help Text" is descriptive.
Comment #14
philipnorton42 commentedStrange about the line endings not being correct. Rather than leave it to chance I think it would be prudent for me to run the PAReview.sh script myself before asking for review again.
You have a good point about the name; it's always best to avoid confusion wherever possible :) I'll play around with a few ideas (I quite like your one) and change it.
Am I right that in order to change it I would need to create another sandbox for a different module?
Comment #15
beanluc commentedNo, thats not necessary. This sandbox's title can be changed, so can this issue's title. You woukd need to change the module's filenames and function names. If you're not familiar, the right way to rename files in git is to run "git mv oldfile newfile". If you just use mv, git is not aware and treats oldfile as deleted and newfile as without history.
Comment #16
misc commented@philipnorton42 has been contacted to ask if the application is abandoned.
http://drupal.org/node/894256
Comment #17
misc commented@philipnorton42 writes back that the application is not abandoned.
Comment #18
philipnorton42 commentedFinally got around to changing the name of the project. After some deliberation I went for "Custom Help Text" instead of "Hook Help". As a precaution I have run everything through SimpleTest and coder to check that I haven't changed the functionality at all.
Comment #19
tyler.frankenstein commentedI have downloaded and installed the 6.x-1.x version on my localhost D6 site. The module works well and is very useful. I was able to easily add help messages to the top of various forms and nodes.
One strange thing that I noticed here for example (admin/build/custom_help_text/edit/2), I am unable to get the 'user role' checkboxes to stay checked. I tried turning on/off the 'view custom_help_text' perm to see if that would get the checkboxes to stick, but that didn't work either.
Basically, I was unable to get the 'user roles' checkboxes to do anything. This would be a nice feature, so you could limit the visibility of the help text to certain roles.
Also, the text 'Leave empty to add to all user roles ('view custom_help_text' permission will prevent certain users from seeing it).' near the checkboxes mentioned above is confusing to me. It seems vague/contradictory... this could use some clarification.
Other than that, nice job on this module. The only thing I would recommend is adding another field to allow the user to specify a drupal message box class (status, warning, error) along with each custom help text. That way when the custom help text is displayed it can 'stand out' a bit more, and user's won't have to write any css to spice up the custom help box. But perhaps this could be added later as a new feature once the project is up and running officially.
Comment #20
philipnorton42 commentedHi Tyler,
Thanks for taking the time to look at this module.
I did a complete rethink on the way that user roles are assigned and saved and I think this mechanism makes more sense. Essentially, when creating a help message you need to assign user roles that the help message will be displayed to. The permission 'view custom_help_text' controls access to the help messages on a permission level, so I have taken this into account and only load in the roles that have this permission.
Good idea about the custom class I'll have a think about that :)
Comment #21
tyler.frankenstein commentedHi Philip,
I gave your module another try with a fresh Drupal 6.24 install. Again I used it to add some custom help text messages to places like the contact page, the user login and registration pages, as well as the node add story page. The custom text appeared for all cases. I then tried flipping on/off the new user role mechanism you setup (much better by the way) and visiting each page as an anonymous/authenticated user to make sure it worked as expected, it did.
In my opinion this module is good to go, except there are some coding standard issues that should be cleaned up:
http://ventral.org/pareview/httpgitdrupalorgsandboxphilipnorton421193750git
Comment #22
philipnorton42 commentedI have sorted all of the issues and re-run the PAReview.sh report via the ventral.org site.
http://ventral.org/pareview/httpgitdrupalorgsandboxphilipnorton421193750git
Comment #23
beanluc commentedNicely done. RTBC for me. I'll use a module like this regularly - currently I just write a module on a per-project basis with explicit, specific custom helptext messages in it as aids for my clients and their content-authors and site-admins. A re-useable generic solution is brilliant.
This is great in its current state. I will share one detail which has recently been pointed out to me. That's that any strings in the module which go through t() would be best wrapped in double quotes rather than in single quotes with escape-slashes behind any single quotes in the string. That's because the code and string are easier to read but more importantly the presence of escaping-slashes can introduce reliability problems if those strings ever are translated.
Suggestions for improving this module:
Obviously, porting to D7.
Making help-texts and mapped paths exportable.
Providing token support in the messages or the paths.
Providing for drupal_set_messages as well as help text (you can do this with things like Rules and Context, but, what overkill just to set status message and mode).
Providing for contextual links on the messages, for admin tasks.
Just suggestions! It just goes to show that your module has lots of potential because it's such a good idea.
Comment #24
klausiWould you like to take part in the review bonus program? I personally only review/approve applications with a review bonus, but of course you can also wait for other git administrators to take a look at your code.
Comment #25
mlncn commentedCongratulations philipnorton42 on a long review process and learning a lot about Git and d.o idiosyncracies too! You are now a vetted Git user and can promote this and other projects you create to full project.