Download & Extend

Bug in trigger module behavior

Project:Drupal core
Version:7.x-dev
Component:trigger.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)
Issue tags:trigger

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
trigger.patch583 bytesIdleFailed: Failed to apply patch.View details | Re-test

Comments

#1

Status:needs review» needs work

The last submitted patch failed testing.

#2

Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.02 KBIdleFailed: Failed to apply patch.View details | Re-test

#3

Status:needs review» needs work

The last submitted patch failed testing.

#4

Status:needs work» needs review
AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.07 KBIdleFailed: Invalid PHP syntax in modules/trigger/trigger.admin.inc .View details | Re-test

#5

Status:needs review» needs work

The last submitted patch failed testing.

#6

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.04 KBIdleFailed: 9683 passes, 66 fails, 0 exceptionsView details | Re-test

#7

Status:needs review» needs work

The last submitted patch failed testing.

#8

I think the manual node override is causing problems.

#9

Status:needs work» needs review

Apparently, I forgot to attach.

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.19 KBIdleFailed: 10267 passes, 1 fail, 0 exceptionsView details | Re-test

#10

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.

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.36 KBIdleFailed: Failed to apply patch.View details | Re-test

#11

Status:needs review» needs work

The last submitted patch failed testing.

#12

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.23 KBIdleFailed: Failed to apply patch.View details | Re-test

#13

Status:needs review» needs work

The last submitted patch failed testing.

#14

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?

#15

Status:needs review» needs work

The last submitted patch failed testing.

#16

Status:needs work» needs review

I think the auto tester had another bad day.

Apparently nobody wants this fixed?

#17

Status:needs review» needs work

The last submitted patch failed testing.

#18

Title:Trigger module behavior does not conform to documentation» Bug in trigger module behavior
Status:needs work» needs review

Re-rolling to account for #353069: Make drupal_get_form to return unrendered forms.

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.25 KBIdleFailed: 11559 passes, 11 fails, 0 exceptionsView details | Re-test

#19

Status:needs review» needs work

The last submitted patch failed testing.

#20

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.08 KBIdleFailed: Failed to apply patch.View details | Re-test

#21

Status:needs review» needs work

The last submitted patch failed testing.

#22

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc_.patch1.08 KBIdleFailed: 11559 passes, 11 fails, 0 exceptionsView details | Re-test

#23

Status:needs review» needs work

The last submitted patch failed testing.

#24

Status:needs work» needs review

Missed a line in my namespace removal patch.

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc2_.patch1.1 KBIdleFailed: 11555 passes, 12 fails, 0 exceptionsView details | Re-test

#25

Status:needs review» needs work

The last submitted patch failed testing.

#26

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
trigger.admin_.inc3_.patch1.04 KBIdleFailed: 11555 passes, 12 fails, 0 exceptionsView details | Re-test

#27

Status:needs review» needs work

The last submitted patch failed testing.

#28

Status:needs work» closed (duplicate)

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

#29

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?