Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
file system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2009 at 10:23 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
amogiz commentedLooking for the same issue …
Comment #2
shawn_smiley commentedI'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. :-)
Comment #3
smk-ka commentedShawn is right, unfortunately there is nothing we can do about it... until D7, which removed this annoyance.
Comment #4
simeYou can't use string replacements in this case. The only way I've achieved it is:
Comment #5
tberger97 commentedI simply commented out the line in the file.inc and it works fine
Comment #6
mstevetodd commentedThis page: http://www.appnovation.com/can-we-modify-drupal-status-messages
includes a more complete example. I found it very helpful and am using it on my site.
Comment #7
crea commentedAttaching core patch that replaces all drupal_set_message() calls with watchdog() calls in that function.
Hope it helps someone.
Comment #8
crea commentedLet's try this. I think it's a bug and moving messages into watchdog shouldn't hurt anyone.
Comment #9
Monzer Emam commentedsubscribe
Comment #10
NedFlanders commentedI found a way to hide these messages using the String Overrides module. The string that needs replacing is:
The directory %directory has been created.Find a more detailed explanation in this blog post.
Comment #11
gnindl commentedApplied patch from #7 successfully.
It's quite annoying to have this kind of messages on a production site.
The place for this is inside the watchdog table.
Comment #12
kenorb commentedIt's possible as well to workaround this by Drupal Tweaks module and hide specified message.
Comment #13
gábor hojtsyI understand you are not entirely happy with some background actions omitting strange messages on the page. However, we should figure out where core / major contrib uses these and intend to show the user a message and act on displaying messages in that case. An API function displaying messages to the user is not a good idea.
Also, bugs should be fixed in D7 first (if applicable). Looks like @smk-ka says this is not applicable to D7, do I understand that right?
Comment #14
smk-ka commentedExactly – see file_prepare_directory().
Comment #15
Anonymous (not verified) commentedshubshcribe.
Comment #16
crea commentedGábor Hojtsy,
Filefield (or Imagecache) uses the function so this affects really LOT of sites. I don't understand what else is needed ? Setting back to NR because of this.
Comment #17
13rac1 commentedsub
Comment #18
ales.blaznik commentedsubscribe
Comment #20
mkalkbrennerTested the patch and attached a version that not triggers the D7 test bot.
Comment #21
grendzy commented+1 for this change. It's frustrating when you use a token in a filefield path (such as sites/default/files/photos/[uid]).
I think what Gábor is asking is, are there places where this message is actually expected? If so, the appropriate form submit function would need to be updated with a drupal_set_message.
In this case, I'm not sure there is ever a legitimate need for this message. The functions that call file_check_directory are color_scheme_form_submit, drupal_build_css_cache, drupal_build_js_cache, file_check_path, system_check_directory, system_theme_settings, upload_form_alter, user_admin_settings, _locale_rebuild_js. None of them jump out as requiring this message.
Comment #22
bfroehle commentedActually the one time when it is useful is in system_file_system_settings(), i.e. the File System settings page.
Comment #23
killua99 commentedsubs +1
Comment #24
gábor hojtsyYes, as discussed, we still need to ensure to have feedback at places where the user should be informed the directory is created. I think system_file_system_settings() is a good example. I did not do a full audit of places where this would be useful, but I'm still vary of removing it entirely.
Comment #25
Anonymous (not verified) commentedmake it a watchdog please
Comment #26
kmajzlik commentedThe very best should be settings form with per role setting: message/watchdog.
With that admin can set messages for his role, but normal users/anonymous will not see that annoying thing and admin can search log.
Comment #27
rjbrown99 commentedIMO, this is also a potential security issue, specifically information disclosure. If directory creation messages are presented to end users, they include the full path to the site and name of the directory that was created. That information could be leveraged if the user can also upload to that directory. I would rate it as low risk, but I think it's a bad idea at all levels to expose full file paths to end users.
Comment #28
j00lz commentedin settings.php works for me.