I believe that the actions and triggers in Drupal 6 are a very welcome enrichment, and the idea has a huge potential. Hence this request for generalization.

1. Allow combined triggers and combined actions.

There is already one combined trigger, but only because the second part of the trigger has been put into an action—the posting or updating of a node or comment AND the presence of a string in it lead to the action.

However, when you not only want the posting to be unpublished, but also send an email to the admins, then you're out of luck with the current design.

A simple first step would be to make the presence of a string a trigger and to allow an AND combination of several triggers. Example:

IF a comment is changed AND it contains the string "http://" or "www." THEN unpublish it, THEN show a mesage to the user, THEN send email to admins.

2. Give us more triggers.

I'd like triggers and actions like:

  • The trigger posting's author (or editor in case of a change) is new, less than a month since registration.
  • This posting's author is very new, less than 48 h since registration.
  • This posting's author has no published postings.
  • This posting contains one or more external links.
  • This posting matches this regular expression.
  • This entire thread (node and comments) contains this string.
  • This entire thread matches this regular expression.
  • Send email to the node author.
  • Send email to the trigger posting's (node or comment) author.
  • Send email to all node and comment authors of this thread.
  • Send email to each author in this thread whose posting (node or comment) contains this string. (I'd like to generalize this functionality, but don't know how to do this in a simple way. Perhaps we need a simple trigger-action script language.)

    3. String matching should not be case-sensitive.

    In almost all practical cases, case-sensitive string matching is unwanted. I wouldn't even bother to add a checkbox for case sensitivity.

    Moreover, string matching should be intelligent. Let a space in the search string match any whitespace, including line breaks.

    Conclusion

    With some enhancements like these, triggers could be grown into an extremely powerful tool for Drupal operators that nobody would like to miss.

  • Comments

    miro_dietiker’s picture

    While introspecting the code i've realized the context normalization is a problem too.
    Current normalization addresses trivial rules. The problem is there many times always multiple relations between types. E.g. normalization from a node to a user could be "author", "updater" (of the most recent revision) or "originator" or even a referred user from a cck field(?)... There are many such situations. And remember e.g. Views still don't support nested AND/ OR conditions or don't support OR at all...

    Generalizing of the other things to me means also to provide object relationship implementation. In a way this all reminds me the cck field definition and views field definition.. But if we have the full field approach and all relationship information, we could do anything with triggers.

    BTW: Did you already consult the module workflow?

    fago’s picture

    I think what you really want to do are conditions. Check out the rules modules if you don't know it.

    sun.core’s picture

    Status: Postponed (maintainer needs more info) » Active

    Proper status.

    sun.core’s picture

    Version: 7.x-dev » 8.x-dev
    xjm’s picture

    Version: 8.x-dev » 7.x-dev
    Status: Active » Closed (won't fix)

    Based on #764558: Remove Trigger module from core, this issue will not be fixed since Trigger has been removed from D8. I'd suggest the Rules module, since the D8 contrib version of trigger is likely to be maintenance only.