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.
The documentation for hook_hook_info states that the return value should be:
Return value
- A nested array. The outermost key defines the module that the triggers are from. The menu system will use the key to look at the .info file of the module and make a local task (a tab) in the trigger UI.
- The next key defines the hook being described.
- Inside of that array are a list of arrays keyed by hook operation.
- Each of those arrays have a key of 'runs when' and a value which is an English description of the hook.
However, the actual behavior is (Change is underlined)
Return value
- A nested array. The outermost key defines the module that the triggers are from. The menu system will use the key to look at the .info file of the module and make a local task (a tab) in the trigger UI.
- The next key is the module name again..
- Inside of that array are a list of arrays keyed by hook operation.
- Each of those arrays have a key of 'runs when' and a value which is an English description of the hook.
I have attached a patch that I believe rectifies this.
I should also mention that all the documentation I could find for this feature assumes that the first two keys do not have to be identical.
Comment | File | Size | Author |
---|---|---|---|
#26 | trigger.admin_.inc_.patch | 1.04 KB | antgiant |
#24 | trigger.admin_.inc_.patch | 1.1 KB | antgiant |
#22 | trigger.admin_.inc_.patch | 1.08 KB | antgiant |
#20 | trigger.admin_.inc_.patch | 1.08 KB | antgiant |
#18 | trigger.admin_.inc_.patch | 1.25 KB | antgiant |
Comments
Comment #2
antgiant CreditAttribution: antgiant commentedComment #4
antgiant CreditAttribution: antgiant commentedComment #6
antgiant CreditAttribution: antgiant commentedSpending more time convincing test bed it's validly formatted than I did fixing the bug.
Comment #8
antgiant CreditAttribution: antgiant commentedI think the manual node override is causing problems.
Comment #9
antgiant CreditAttribution: antgiant commentedApparently, I forgot to attach.
Comment #10
antgiant CreditAttribution: antgiant commentedSince the original design may have been attempting to prevent namespace collisions. Here is a new patch that requires the "hook being described" to begin with the module name.
Comment #12
antgiant CreditAttribution: antgiant commentedre-rolling to account for #383066: hook_nodeapi_X => hook_node_X
Comment #14
antgiant CreditAttribution: antgiant commentedI think the auto tester had a bad day.
P.S. Is there anyway to get notification of testing failure?
Comment #16
antgiant CreditAttribution: antgiant commentedI think the auto tester had another bad day.
Apparently nobody wants this fixed?
Comment #18
antgiant CreditAttribution: antgiant commentedRe-rolling to account for #353069: Make drupal_get_form to return unrendered forms.
Comment #20
antgiant CreditAttribution: antgiant commentedUndoing namespace restriction from #10 as it appears to be crashing cron. Perhaps related to #246096: Cron triggers are not executed.
Comment #22
antgiant CreditAttribution: antgiant commentedI suppose I deserve that for trying to edit the patch directly.
Comment #24
antgiant CreditAttribution: antgiant commentedMissed a line in my namespace removal patch.
Comment #26
antgiant CreditAttribution: antgiant commentedIt seemed like a good idea at the time to check that. Sigh.
Comment #28
antgiant CreditAttribution: antgiant commentedI believe that #324183: Better Access Control in Custom Triggers is the root cause of this problem.
Comment #29
gnassar CreditAttribution: gnassar commentedSince now #324183: Better Access Control in Custom Triggers is effectively a WONTFIX for 7.x and will only be dealt with in 8.x, should this issue be reopened?