Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm using Rules to redirect the user to a different page after a node has been created.

Is there an easy way to suppress the sticky "XXXXX has been created" message?

share|improve this question
    
The only way I can think of is using a custom module. Would that be a solution for your case, if nothing else is available? –  kiamlaluno Feb 9 '12 at 20:08
    
I have a custom module that disables some fields only meant for admin users but I basically want the content type to behave like a normal form submission. –  Tommy Feb 10 '12 at 18:30
add comment

3 Answers

It's node_form_submit that is creating those messages. You could pretty easily use hook_form_alter on the node form and use your own version of node_form_submit instead. All you would need to do, would be to copy the function and add an user_access('whatever') check before that message is created.

Alternatively, you could in preprocess_page function, check which messages is being served, and remove unwanted ones, but that would be a bit more tricky. Should be possible with some regex. On the other hand, this method would be a bit more upgrade friendly, since you could remain using the node_form_submit function and would get future changes if any.

share|improve this answer
add comment

You can use Disable Messages drupal module to hide specific messages from users

share|improve this answer
add comment

If you're using D6 you can use Better Messages module.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.