How to suppress one specific warning? I have one specific warning in Drupal 7 from the workbench module which I do not want to display. All other warnings should not be changed.

For now I edit the workbench module by comment the specific line which is not the way it should be solved for final.

I tried to use disables messages wit a specific regex but this is not working. I think because it is a warning and not a message.

I prefer to use hook_page_alter but cannot find the specific warning in the $vars array.

Any suggestion for this or what approach and possibility is there to solve this?
Solved it in Hook_preprocess_page(&amp;$vars) {

  $all_warnings = $_SESSION['messages']['warning'];
  foreach ($all_warnings as $nr =&gt; $messageinfo) {
      if (strpos($messageinfo,"do not have permission to moderate") != false){
        unset ($_SESSION['messages']['warning']);
      }
  }