When using Imachecache to create images (thumbnails) the site shows even for an anonymous user the message: The map sites/default/files/imagecache/... is created
Error Reporting is for the site set to write only to the logfile. So it should not be shown.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | image_cache_446634.patch | 1.06 KB | drewish |
| #26 | 446634_imagecache_dir_created.patch | 818 bytes | fenstrat |
| #18 | 446634_imagecache_dir_created.patch | 807 bytes | fenstrat |
| #9 | imagecache.446634.patch | 446 bytes | jhedstrom |
Comments
Comment #1
joostvdl commentedComment #2
drewish commentedWell it's not an error message so that setting wouldn't be honored but it doesn't really make sense to show that to users.
Comment #3
drewish commentedHumm... that's actually a side effect of using core's file_check_directory() to create the directories... I want to keep using that since it's got a bunch of useful checks in there. Maybe we could do some hackery to remove the message.
Comment #4
tsvenson commentedSubscribing. Working on a site that will be released soon, so I hope you find a solution in a not so distant future :)
Comment #5
paganwinter commentedSubscribing...
Comment #6
askibinski commentedSubscribing.
Until this is properly patched, I guess a quick workaround could be to check the $messages variable in the theme layer for any occurence of the word 'imagecache' in which case you wouldn't show the $messages at all. (But this would also prevent any addditonal messages being possibly displayed at that time)
Comment #7
jhedstromSubscribing.
Comment #8
drewish commentedjhedstrom, i saw your user name in the email and was thinking to myself "sweet, he'll have posted a patch and i can just put this issue to rest". now i'm disappointed, get on it! ;)
Comment #9
jhedstromSince the issue is with file_check_directory, a hack is the only way around, and the only one I could think of was to flush all messages. This should be okay though since other messages shouldn't be added during this callback...but it's still a hack. Perhaps it would be less of a hack if it checked only for anonymous users...
Comment #10
donquixote commentedsubscribe
Comment #11
bonked commentedSubscribe.
Comment #12
asak commentedsubscribing (and using patch #9 for now...)
Comment #13
drewish commentedmarked #545068: How to remove "xxx directory was created" message from anonymous user? as a duplicate.
Comment #14
yang_yi_cn commentedSubscribing.
Comment #15
OneTwoTait commentedsubscribe
Comment #16
rc2020 commentedsubscribe
Comment #17
hefox commentedPatch works, +1 :).
Comment #18
fenstratSame "hack" as per #9, with the addition of only clearing the message for anonymous users.
Comment #19
fenstratComment #20
manuel garcia commenteddeffinetly a must, havent looked a the patches, but well, we dont want to have to hide all messages from the user just because of this... imho it should've never gotten in as a normal message, as it is meant to be for either debugging or for the administrator good sleep at night... switching to critical. Perhaps another way about doing it is to allow the admin to switch on/off the messages, or to only write them to the watchdog or something like that.
Comment #21
hefox commentedI believe messages are stored in $_SESSION, so I believe can preg those messages and if find a directory creation, remove it.
Also, I don't see why the message would be important other than for potentially debugging purposes, so dislike for empty($user->uid) :(. Not all users are admin users, ie. community based sites.
Comment #22
mherb204 commentedPatch in #9 doesn't work for me. fatal error Call to undefined function e_preset_flush - which means broken site!
function imagecache_action_delete($action) {
db_query('DELETE FROM {imagecache_action} WHERE actionid=%d', $action['actionid']);
$preset = imagecache_preset($action['presetid']);
imagecache_preset_flush($preset);
imagecache_presets(TRUE);
}
e_preset_flush($preset);{
imagecache_presets(TRUE);
}
I changed it to
function e_preset_flush($preset){
imagecache_presets(true);
}
that got the fatal error to go away and the site to come back up but... the directory creation messages are still popping up
I am launching my site in a few days and this looks bad when users see this.
Help please
Comment #23
benone commented+1
when it will be in dev or beta ?
Comment #24
benone commentedNot only to anonymous. To everybody. Only user 1 should see that.
Comment #25
Kane commented+1
Comment #26
fenstratSame as #18 but removes the message for all users except uid 1.
This covers the community based site case, but also keeps things simple.
As mentioned above, the other alternative is to create an admin setting to hide/show the message and/or write message to watchdog. Could be a bit overkill?
Comment #27
drewish commentedWhat about this? It only clear status messages (leaving errors and warnings) from all but imagecache admins.
Comment #28
manuel garcia commentedsome might request for all messages to be displayed only to imagecache admins... good enough for me though!
Comment #29
fenstrat#27 seems like the best solution.
Comment #30
drewish commentedcommitted to HEAD.
Comment #31
drewish commentedalso committed to DRUPAL-6--2.
Comment #32
manuel garcia commentedThanks a lot guys
Comment #34
ryan_courtnage commentedJust a note for those looking for this fix. It's not in 6.x-2.0-beta10.
Presumably it'll make beta11 (although I'm unsure how to determine this with git)
Comment #35
d.clarke commentedI know I'm a little late to this thread but I'm not sure I'm a fan of just stomping on any potential status messages in order to suppress these messages. Can we do something like the following patch (d.o wouldn't let me attach it)?
Comment #36
gooddesignusa commentedsub. thank you patch from #27 worked for me.