Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If for some reason a derivative is missing, it is automatically regenerated. Wouldn't it be better to notify the site-admin instead of confusing a visitor? To solve this, only a minor change is required: change line 627
drupal_set_message(t('The image %title had missing derivative image which has been regenerated.', array('%title' => $node->title)));
to:
watchdog('image', t('The image %title had missing derivative image which has been regenerated.', array('%title' => $node->title)), WATCHDOG_NOTICE);
Comment | File | Size | Author |
---|---|---|---|
#20 | image-HEAD.messages.patch | 3.8 KB | sun |
#17 | image-HEAD.messages.patch | 4.23 KB | sun |
#12 | derivative_messages.patch | 2.38 KB | John Bickar |
#11 | derivative_message.patch | 946 bytes | John Bickar |
Comments
Comment #1
drewish CreditAttribution: drewish commentedit's a good idea to add those to the watchdog but i'd still like to show the message to an admin.
Comment #2
VDG CreditAttribution: VDG commentedI understand, but the output of drupal_set_message is shown to every user, so for visitors this could be confusing. Also, if a visitor gets the message, the admin won't know. On the other hand, if you send it to the watchdog, everyone with permission to access the administration pages will see the message.
An alternative would be to check $user->uid or $user->rid.
Comment #3
Standart CreditAttribution: Standart commentedI agree. This is not a message for end-users.
Comment #4
drewish CreditAttribution: drewish commentedi think anyone with 'edit images' permission (which would include uid=1 by default) should see the message.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedI agree with VDG. This message isn't helpful for visitors/users and should be logged only.
Comment #6
Will KirchheimerFrom my point of view (large social networking site, lots of people uploading images)
It seems to me that this is a admin level message
2 cents
Comment #7
drewish CreditAttribution: drewish commentedroll a patch. i've already said that i'm okay with changing it to making it an admin feature.
Comment #8
drewish CreditAttribution: drewish commentedaccidentally posted the patches for this over on:
http://drupal.org/node/156127#comment-293037
http://drupal.org/node/156127#comment-293039
screwed up the commit messages too...
Comment #9
(not verified) CreditAttribution: commentedComment #10
yhager CreditAttribution: yhager commentedI'm reopening this, since the issue is happening again.
See this diff:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/image/image...
Comment #11
John Bickar CreditAttribution: John Bickar commentedPatchy attachy.
Comment #12
John Bickar CreditAttribution: John Bickar commentedPatch updated to send all messages to the watchdog that anonymous users should not see about derivative images being rebuilt.
Comment #13
sunAs drewish mentioned, the messages should be displayed for administrative users and only hidden for regular/anonymous users.
Comment #14
sunBetter title. A proper patch has very chances to be committed, instantly.
Comment #15
John Bickar CreditAttribution: John Bickar commentedComment #16
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedIMO the messages should be completely dropped. They don't provide useful info. Failure to create derivatives should be recorded instead.
Comment #17
sunComment #18
Leeteq CreditAttribution: Leeteq commentedIt would be important for admins to get to know if a site has a problem and is regenerating images more often than what is "normal". How to cater for that?
These messages should not be shown to the end user, not even with those with edit picture permissions.
As an admin, it should also be possible to avoid them.
If it is important for a user with such permissions to verify that images have indeed been regenerated, then better provide an overview/log page for this, which filters relevant messages from the watchdog.
Comment #19
Standart CreditAttribution: Standart commentedHow about giving the admin the choice on the settings page to turn on logging of derivative image size creation in the watchdog?
Comment #20
sunThanks for reporting, reviewing, and testing! Committed attached patch.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.