4

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?

2
  • 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?
    – apaderno
    Commented Feb 9, 2012 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
    Commented Feb 10, 2012 at 18:30

3 Answers 3

3

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.

1

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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