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.
I've created two rules to display a message to the user after a node has been created. Both of them however are appearing before the Drupal system message "(node title) has been created". It would make more sense for the "node has been created" message to appear first, and then my custom messages. Is it possible to do this? I've set the weights of both my custom message rules to 10 to see if this would make them appear below the system message but this doesn't work.
Comments
Comment #1
lyricnz CreditAttribution: lyricnz commentedMake a PHP action that fiddles with $_SESSION['messages'][$type] to rearrange as required. Add this action below the place where both messages are emitted.
Comment #2
rodrigo21 CreditAttribution: rodrigo21 commentedSame issue here. Sorry but I am not an experience user. I looked for function drupal_set_message in the API, but still confused on how to make the 'status' message display before the rule-created message. Could you guide a bit further on this? Thanks.
Comment #3
TR CreditAttribution: TR commentedSystem message are handled by core Drupal and are displayed in the order that they were created. The only way to change that order is to modify the array as in #1. You can do this in a theme function - see the comments at https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drup... for an example.
Comment #4
TR CreditAttribution: TR commented