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.

Files: 
CommentFileSizeAuthor
#26 trigger.admin_.inc_.patch1.04 KBantgiant
Failed: 11555 passes, 12 fails, 0 exceptions
[ View ]
#24 trigger.admin_.inc_.patch1.1 KBantgiant
Failed: 11555 passes, 12 fails, 0 exceptions
[ View ]
#22 trigger.admin_.inc_.patch1.08 KBantgiant
Failed: 11559 passes, 11 fails, 0 exceptions
[ View ]
#20 trigger.admin_.inc_.patch1.08 KBantgiant
Failed: Failed to apply patch.
[ View ]
#18 trigger.admin_.inc_.patch1.25 KBantgiant
Failed: 11559 passes, 11 fails, 0 exceptions
[ View ]
#12 trigger.admin_.inc_.patch1.23 KBantgiant
Failed: Failed to apply patch.
[ View ]
#10 trigger.admin_.inc_.patch1.36 KBantgiant
Failed: Failed to apply patch.
[ View ]
#9 trigger.admin_.inc_.patch1.19 KBantgiant
Failed: 10267 passes, 1 fail, 0 exceptions
[ View ]
#6 trigger.admin_.inc_.patch1.04 KBantgiant
Failed: 9683 passes, 66 fails, 0 exceptions
[ View ]
#4 trigger.admin_.inc_.patch1.07 KBantgiant
Failed: Invalid PHP syntax in modules/trigger/trigger.admin.inc .
[ View ]
#2 trigger.admin_.inc_.patch1.02 KBantgiant
Failed: Failed to apply patch.
[ View ]
trigger.patch583 bytesantgiant
Failed: Failed to apply patch.
[ View ]

Comments

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.02 KB
Failed: Failed to apply patch.
[ View ]

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.07 KB
Failed: Invalid PHP syntax in modules/trigger/trigger.admin.inc .
[ View ]

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.04 KB
Failed: 9683 passes, 66 fails, 0 exceptions
[ View ]

Spending more time convincing test bed it's validly formatted than I did fixing the bug.

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

I think the manual node override is causing problems.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.19 KB
Failed: 10267 passes, 1 fail, 0 exceptions
[ View ]

Apparently, I forgot to attach.

antgiant’s picture

StatusFileSize
new1.36 KB
Failed: Failed to apply patch.
[ View ]

Since 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.

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.23 KB
Failed: Failed to apply patch.
[ View ]

re-rolling to account for #383066: hook_nodeapi_X => hook_node_X

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review

I think the auto tester had a bad day.

P.S. Is there anyway to get notification of testing failure?

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review

I think the auto tester had another bad day.

Apparently nobody wants this fixed?

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Title:Trigger module behavior does not conform to documentation» Bug in trigger module behavior
Status:Needs work» Needs review
Issue tags:+trigger
StatusFileSize
new1.25 KB
Failed: 11559 passes, 11 fails, 0 exceptions
[ View ]

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.08 KB
Failed: Failed to apply patch.
[ View ]

Undoing namespace restriction from #10 as it appears to be crashing cron. Perhaps related to #246096: Cron triggers are not executed.

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.08 KB
Failed: 11559 passes, 11 fails, 0 exceptions
[ View ]

I suppose I deserve that for trying to edit the patch directly.

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.1 KB
Failed: 11555 passes, 12 fails, 0 exceptions
[ View ]

Missed a line in my namespace removal patch.

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Needs review
StatusFileSize
new1.04 KB
Failed: 11555 passes, 12 fails, 0 exceptions
[ View ]

It seemed like a good idea at the time to check that. Sigh.

Status:Needs review» Needs work

The last submitted patch failed testing.

antgiant’s picture

Status:Needs work» Closed (duplicate)

I believe that #324183: Better Access Control in Custom Triggers is the root cause of this problem.

gnassar’s picture

Since 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?