Skip to main content
4 of 7
added 2 characters in body
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

How to suppress a drupal_set_message output by Drupal for site users?

The function file_unmanaged_copy in Drupal core calls drupal_set_message on certain conditions. Even with visible errors messages disabled, anonymous users see this. Indeed, the comment in the code even has a TODO to change it to an exception.

Obviously I don't wish to hack core, so is there a clean way to supress this for anonymous and non-admin users?

Notably, the message is in a t() function, so I could use the stringoverrides module, but this would affect all users (including site administrator), so it's a bit problematic.

njp
  • 737
  • 2
  • 10
  • 29