How do I stop this message from displaying:

The derivative images for (x) have been regenerated.

These messages are constantly popping up now and I don't know why. Why's that happening? How do I stop the messages? Thanks!

Comments

dnewkerk’s picture

I believe that it will be removed in a future release of Image module (which I believe you are referring to). That message comes up whenever you add a new Image size preset, and possibly whenever you even modify a preset.

In an Issue from the Image project I found the following suggestion a while back to turn this message off for non-admin users (it still shows to the admin, but that's ok):

In image.module, find this:

      drupal_set_message(t("%title's %key derivative image had a timestamp (%filetime) that predates the last changes to the image size settings (%vartime). The derivatives will be rebuilt to regenerate it.", array('%title' => $node->title, '%key' => $key, '%filetime' => format_date(filemtime($node->images[$key])), '%vartime' => format_date(variable_get('image_updated', 0)))));

And replace with:

if (image_access('update', $node)) {
drupal_set_message(t("%title's %key derivative image had a timestamp (%filetime) that predates the last changes to the image size settings (%vartime). The derivatives will be rebuilt to regenerate it.", array('%title' => $node->title, '%key' => $key, '%filetime' => format_date(filemtime($node->images[$key])), '%vartime' => format_date(variable_get('image_updated', 0)))));
}

It's exactly the same except it is surrounded by that if statement.

I'll post the original source if I can find it. This is a temporary fix until it's added to the real release (probably the next version that comes out). I like to add a unique bit of text in comments surrounding any change I make in a module like this, so I can instantly re-locate it later by typing that into a Find (I usually use my name). I only do this for a temporary fix where the real fix is coming in an actual release soon - never to modify a module permanently.

Nice site by the way :)

-- David
davidnewkerk.com | absolutecross.com
View my Drupal lessons & guides

HollywoodChicago.com’s picture

The messages just stopped appearing for some odd reason, but thank you for the very helpful information!