[Drupal ImageCache] %252F in URL of ImageCache preset when using Drupal Views

| | 2 min read

Some Drupal users have reported that when they were using a combination of Drupal Views and Drupal Imagecache, i.e using an Image Cache preset to be displayed in a View they found %252F in the URL of ImageCache preset. If you are facing the same scenario with your Image Cache presets in your Drupal site and want to know more about this then continue reading.

The %252F in URL of ImageCache preset in the View can be caused by two factors.

  • Your View is passing a path sans the leading file directory path, but with a leading slash or
  • Your Image Cache presetname has a trailing slash

Knowing how the ImageCache builds the preset path might be of help in solving the issue.

  • The Image Cache preset path is created from the original image path.
  • If the image path begins with the file directory path, that portion is eliminated together with the next slash. For e.g.
  • sites/default/files/images/pic.jpg -> images/pic.jpg
  • Then the ImageCache preset proceeds to use the file directory path, the word imagecache, the presetname and the processed path from above and its combined to form
  • sites/default/files  /   imagecache   /   presetname   /   images/pic.jpg
  • If there is a // in the URL it is converted to /%252F

Hope that helps.

The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites. Get in touch with us to know more.