Since updating core to version 7.20, uploaded images with AIS aren't visible. Images uploaded before core update show up fine.
Apparently this bug is common with some other image-related modules:
#1923936: Responsive images and styles module doesn't work with Drupal 7.20
#1923336: Insert module doesn't work with Drupal 7.20

Members fund testing for the Drupal project. Drupal Association Learn more


spotzero’s picture

Status: Active » Needs work

Until we figuring out a fix, please add this setting into your "settings.php" file:

$conf['image_allow_insecure_derivatives'] = TRUE;
markusa’s picture

Does this hold for 7.21?

spotzero’s picture

Yup. Still broken, but the $conf['image_allow_insecure_derivatives'] = TRUE; work around will still work.

kingfisher64’s picture

removed comment as solution found and found out it is not relevant to this thread.

Snowflake6’s picture

Drat. I've had this problem since update to 7.21 and the 'image_allow_insecure_derivatives' fix doesn't work.

kristin.e’s picture


spotzero’s picture

Snowflake6: 'image_allow_insecure_derivatives' should work. If it isn't, you may have another problem :S

srjosh’s picture

Status: Needs work » Needs review
5.53 KB

This patch will create a menu callback, reroute via .htaccess to that menu callback, then copy/modify the image_style_deliver() function to deliver the goods. Primary difference between image_style_deliver and this function is that it checks the token for "adaptive" image style, instead of the image style passed into the function.

This allows it to work with the check against the $_GET parameter, which by design is generated from the "adaptive" image style and not the actual image style we're using based on the cookie.

Rolled against latest dev checkout.

srjosh’s picture

8.05 KB

Updated patch that will actually work (better menu path and style loading handler)

spotzero’s picture

Thanks for the patch srjosh, that's a clever solution.

Can you re-roll your patch against the latest dev? I had to clean out some stuff that would prevent it from working.


srjosh’s picture

5.47 KB


David_Rothstein’s picture

2.38 KB
+    'access arguments' => array('View published content'),

There is no such permission, so this patch doesn't work for anyone except user 1 :)

Otherwise, it looks like a great approach, but a couple things to note:

  1. It's a lot of code duplication (and in fact is already out of date compared to Drupal core)...
  2. Won't this be a big performance hit? It seems like it will bootstrap Drupal every single time the image URL is visited, even after the image was already generated on disk.

I think using hook_menu_alter() may be better here. Attached is a patch that does that; it seems to work for me.

srjosh’s picture

That's really smart. I'll test it on my application and get some notes back here.

spotzero’s picture

I like this patch. I'll test it out and if all goes well, I'll rolled it in.

Thanks a lot!

spotzero’s picture

Status: Needs review » Fixed

The patch looks good. I've committed it to the dev branch.

Liliplanet’s picture


I've just upgraded to 7.x-1.5, ran update.php and everything has been working fine up till now ..

Apache Detected
.htaccess file found
Drupal Clean URL Rewrite found
Found RewriteBase rule
RewriteBase correctly configured: /
AIS rules found
AIS rules found before Clean URLs rules

When I upload a new article with an image, the image does not show and there is nothing in the dblog reports.

I upgraded to the 7.x-1.x-dev version of 2 April, still no happiness
then patched as per #12, still nothing
added $conf['image_allow_insecure_derivatives'] = TRUE; to settings.php, no joy

Tried to revert to 7.x-1.4 and going back to that version, website went complete down.

Looking most forward to your urgent reply, and thank you

UPDATE: I've had to revert to a database backup from yesterday, will wait before I upgrade .. thank you for your wonderful module :)

spotzero’s picture

Priority: Major » Critical
Status: Fixed » Active

7.x-1.x and 7.x-1.5 are currently exactly the same, and they include the patch from #12.

Try using 1.5, and make sure to run either "drush updatedb" or go to "/update.php" on your site.

spotzero’s picture

Status: Active » Fixed

Liliplanet, it's possible you ran into this issue:

Try AIS 1.6, if you still have problems, please open a new issue.


Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Links added to similar issues from other modules