Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294835

Image styles fails with absolute path in $settings['file_public_path']

$
0
0

Problem/Motivation

My concern is to use the ability provided by $settings['file_public_path'] and $settings['file_public_base_url'] to
provide a separate webserver dedicated to serve static files and user content. For security, this web server has
deliberately no PHP support.

To facilitate the debug of this issue, I created a simple docker-project hosted on Github:
https://github.com/mickaelperrin/drupal-issues/tree/2754273-image_styles...

Steps to reproduce using the docker container:

1. Launch the docker container with docker-compose up -d`
2. Go to http://your.docker.machine.ip:8888
3. Authenticate with drupal / drupal
4. Go to http://your.docker.machine.ip:8888/node/add/article
5. Click on the "Add image" button
6. Select a file

Exepected result: The thumbnail of the selected image is properly displayed

Result: The thumbnail show a missing image (error 404)`

Proposed resolution

The problem seems to be related with the `PathProcessor`of the module `image`. It appends at the beggining of the
public setting path a slash wether the path is absolute or relative.

In case of absolute path, two slashs begin the path and the method to detect if the path is public or private fails, and
so on the url processing.

The attached add a simple test to check if a slash is needed or not.

You can test the issue with the path by launching the docker containers with the command: `docker-compose -f docker-compose.yml -f docker-compose.patched.yml up -d`

Remaining tasks

As it is my first patch and I am new to Drupal, a review is obviously needed.


Viewing all articles
Browse latest Browse all 294835

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>