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

lyricnz’s picture

Make a PHP action that fiddles with $_SESSION['messages'][$type] to rearrange as required. Add this action below the place where both messages are emitted.

rodrigo21’s picture

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

TR’s picture

Issue summary: View changes
Status: Active » Fixed

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

TR’s picture

Status: Fixed » Closed (fixed)