Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hook_image_effect_info() allows you to include a 'help' text with your effect definition.
"help": (optional) A brief description of the effect that will be shown when adding or configuring this image effect.
However, image_effect_form()
never displays the help text.
Fix: Display the $effect['help'] information if present at the top of the effect add/edit form.
Comment | File | Size | Author |
---|---|---|---|
#14 | 658068-theunraveler-effect_help_text.patch | 1.14 KB | theunraveler |
#1 | 658068-eojthebrave-effect_help_text.patch | 643 bytes | eojthebrave |
Comments
Comment #1
eojthebraveThis should do it. And marking as critical since this really should be fixed for Drupal 7.
Comment #2
matason CreditAttribution: matason commentedThis patch applies cleanly and displays the effect help at the top of the form.
Comment #5
Dries CreditAttribution: Dries commentedWithout studying the surrounding code, is there a reason why we don't use $form['#markup'] instead of $form['effect_help']['#markup']? (I should probably look at the surrounding code.)
Comment #6
matason CreditAttribution: matason commentedDries, I am not sure exactly why but $form['#markup'] doesn't seem to get picked up, it seems to need to be nested...
Comment #7
Dries CreditAttribution: Dries commentedA missing help text is not a critical bug. It is an important bug, but not one that should block a release.
Comment #10
matason CreditAttribution: matason commentedDries, regarding #7, I completely agree, this is an easy fix, #1 does the job.
Comment #11
webchickIs there a reason this isn't in hook_help()?
Comment #12
eojthebraveI believe it was done this way so that modules which add additional effects could declare the help for those effects in hook_image_effect_info(). Though image.module could collect them into hook_help(), or every module that declares image effects could implement hook_help() itself. Preference?
Comment #14
theunraveler CreditAttribution: theunraveler commentedHere's a patch that displays the help text with hook_help().
Comment #15
eojthebrave#14 is the right way to do this. Thanks!
Assuming this passes tests (and I can't see why it wouldn't) this is ready to go.
Maybe not a critical issue, but an important one for sure. Sticking with the theme of making Drupal 7 the most user friendly version of Drupal ever lets make sure this gets in. There are no API changes and it is a super simple change fixing something that should have been working in the first place.
Comment #16
webchickGreat. Thanks a lot, folks!
Committed to HEAD.