Can we hide "The directory * has been created."

SeanBannister - September 28, 2009 - 10:23
Project:ImageCache
Version:6.x-2.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

I've noticed when Imagecache creates a new directory it displays a message to the end user "The directory * has been created."

Is there anyway to hide this message as the end user really doesn't need to know that the directory was created.

#1

amogiz - October 5, 2009 - 11:58

Looking for the same issue …

#2

Shawn_Smiley - October 14, 2009 - 17:29

I'd love to see this option too, but after looking through the code I don't see any way to accomplish it without hacking the Drupal core.

From what I can tell, the message is being generated by the core drupal function file_check_directory() in file.inc. (see http://api.drupal.org/api/function/file_check_directory/6)

The message does go through the t() function though, so it may be possible to use one of the translation routines to replace the message with something else.

I'd love to be proven wrong here. :-)

#3

smk-ka - October 15, 2009 - 20:13
Status:active» won't fix

Shawn is right, unfortunately there is nothing we can do about it... until D7, which removed this annoyance.

#4

sime - October 15, 2009 - 23:10

You can't use string replacements in this case. The only way I've achieved it is:

/**
* Override theme_status_messages() for last minute hack.
* It should be possible to simply return nothing.
*/
function mytheme_status_messages($display = NULL) {
  $output = '';
  $messages = drupal_get_messages($display);
  foreach ($messages as $type => $messages) {
    $output .= "<div class=\"messages $type\">\n";
    $output .= " <ul>\n";

    // This is where you need to check if the message is from imagecache and suppress it.
    foreach ($messages as $message) {
      $output .= '  <li>'. $message ."</li>\n";
    }
    $output .= " </ul>\n";
    $output .= "</div>\n";
  }
  return $output;
}

#5

tberger97 - November 10, 2009 - 16:25

I simply commented out the line in the file.inc and it works fine

 
 

Drupal is a registered trademark of Dries Buytaert.