-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drush runserver won't generate images for image styles with Clean URLs enabled #1189
Comments
Just a little more detail. I'm getting this too running it on Ubuntu 14.04. PHP Version 5.5. GD is installed and working. |
Same problem here, any suggestions? Edit: What's even stranger is that the airballoon test images in image styles admin panel seems to work fine. When adding images through image fields, these images seem to only be uploaded in their original size. Images and even their parenting folders do not seem to be generated. Disabling clean URLs fixes this issue, which is not an acceptable solution, of course. |
Just noticed something. If you run the clean urls test it states for me that it fails... Could that be part of the issue? |
I've got this issue as well. Did anyone find a solution/workaround? |
On my computer it worked after downgrading Drush from 7.0.0 to 6.6.0. |
Hm. When I created this issue originally I was testing with the latest drush 6 release available at the time which appears to be 6.5.0. Is it really possible that this got fixed in 6.6.0? I'll re-test again when I have chance... |
Turns out I was very unclear in my previous comment. Yes it does work in Drush 6.6.0 but it does not work in Drush 7.0. I downgraded to 6.6.0 because my colleague working on the same project had it working on his machine, I simply asked which version of Drush he was using and switched to it. |
Also possible that this error I am seeing: Is related. I am using |
Fixed by #2023 at least for some versions of Drupal. |
<3 |
From what I could tell, Drush 7 uses the built-in PHP server, whereas Drush 6 uses either the php-cgi binary or a contributed PHP server script. @weitzman what in #2023 will help resolve this issue? At the moment the only commits there look unrelated. Are you specifically talking about the error in @dustinleblanc's comment rather than the image derivative issue? |
So, looks like if you This router script does a simple drush/commands/runserver/d8-rs-router.php Line 30 in 91d697e
I've just done a quick and dirty hack and commented out the conditional so that Drupal 7 sites are served using the Drupal 8 router, and now image styles work :) According to the PHP cli docs (http://php.net/manual/en/features.commandline.webserver.php) if a file is not found, then it searches for an It appears that PHP is not doing this correctly :( Maybe we should just replicate the way that the Drupal 8 bootstrap works for Drupal 7 and call the Drupal 7 index.php directly? |
Yeah so appending the following code to $url = parse_url($_SERVER["REQUEST_URI"]);
if (file_exists('.' . $url['path'])) {
// Serve the requested resource as-is.
return FALSE;
}
// Include the main index.php and let core take over.
// n.b. Drush sets the cwd to the Drupal root during bootstrap.
include 'index.php'; Seemed to work fine for me. Normal clean URLs work, and image derivatives are created. EDIT: Sorry, I also changed the way that |
|
Oh, so it looks like #1658 is the PR trying to resolve this issue. |
Lets focus conversation in #1658 |
When running a Drupal site with
drush runserver
and Clean URLs enabled, attempting to access an image for an image style (which hasn't yet been generated) will give 404, rather than cause Drupal to generate the image.Disabling Clean URLs will allow the image to be correctly generated, but obviously affects lots of other things on the Drupal site.
We (the Panopoly project) are using
drush runserver
in our automated Behat tests, and so anything that uses an image style is getting a broken image and messing up the tests. But disabling Clean URLs also breaks a number of our tests which deal with paths, aliases and redirects. And, of course, no one runs with Clean URLs disabled in real life, so it would make our tests more artificial...This issue was reported on D.o at one time, but got no response before the migration to GitHub: https://www.drupal.org/node/1961656
The text was updated successfully, but these errors were encountered: