I'm using Media Entity and Image Bundle, but the upload through the media/add/image_bundle form is not working correctly. After uploading an image it can't be shown on the created node (media/xy). There is just the alt text linked to the original file (if configured in manage display). And in the media list (admin/content/media) the thumbnails are not visible.
UPDATE:
Apparently this is not only a problem with Media Entity but also with normal image fields - when Image Styles are activated (orignal image shows well). So File (Field) Paths correctly puts a file in the intended folder:
Original File: sites/default/files/newsimage/2016/image.jpg
But the path and the file given in the img src doesn't exist:
Image Style File: sites/default/files/styles/large/public/newsimage/2016/image.jpg
UPDATE 2:
So I encountered the same problem in a new project. But this time I noticed that the image style files are created after uploading if one image style is selected in the display options of the content type. If no image style is selected but original image then no image styles are created. So after changing the image style in the display options the image disappears.
Issue fork filefield_paths-2827652
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
johnnny83 commentedComment #3
johnnny83 commentedComment #4
johnnny83 commentedComment #5
rooby commentedThis seems to also happen if you use the retro update.
After the update all the files that were changed do not generate styles anymore.
Comment #6
rooby commentedComment #7
Anonymous (not verified) commentedFor some reason, this module forces uploads to go through the temporary file system in a hook_field_widget_form_alter(). When it does, urls for the image preview are not recognised as image style urls and instead are handled as file downloads, thus resulting in 404.
Not sure if this is the issue OP is referring to, but I found this out using the same modules.
Comment #8
kiwi_steve commentedI'm having the same problem. With a customised file location:
images/[node:field_brand]/[node:title]I'm finding that the related image style location becomes:
/sites/default/files/styles/thumbnail/public/filefield_pathsI believe this is related to
/sites/default/files/filefield_pathsbeing the folder where images go when they are first uploaded in the edit node page. When saved, they shift to the new (correct) location, however the styles do not.Could this be due to the edit page creating and displaying the thumbnail as part of the image upload preview? because if you go back into edit the node the thumbnails are now absent. Is this confusing the styles file locations?
I'd love a solution to this, as this functionality is fairly critical to me. I'll have a look at the module myself, but my PHP skills are years out of date (like my Drupal skills) and somewhat rusty.
Cheers
Steve
Comment #9
kiwi_steve commentedUPDATE:
In my case, I believe I may have found the source of this problem - I'm developing on Windows :)
I haven't yet moved it to my Linux server to see if the issues resolves itself in that environment, but the file names of uploaded images are being stored in the file_managed table of the database like this:
public://images/ultimate/cpu\ultimate_cpu_543377476.jpg...one of these slashes is not like the other, one of these slashes is not quite the same...
If I manually manipulate the database and reverse the last (windows style) slash just before the filename, clear the Drupal cache, and then fully refresh the page (CTRL-F5) - the image styles are created and the image will show up.
Is this just an OS-specific PHP file/path join operation going wrong? If so, as a fix for my own site I can manually manipulate these for the images I'm using in development and then just add the bulk of the data once the site is on the server (assuming it is an OS-specific fault -
I'll test that when I have time). NOTE: I've now ported the site to my Linux webserver and the problem has solved itself... so it seems as if this is indeed a dodgy join operation, using a windows join between the path and the filename when it probably shouldn't beIt seems like this problem might be easy enough to correct.... if I knew where to look.... which I don't :/
Cheers
Steve
Comment #10
rooby commented@kiwi_steve:
There is another issue for the Windows slashes: #2858308: File paths are written to the DB with back slashes on Windows servers
Could be related but I think they are separate issue.
[EDIT] actually now I'm second guessing myself, but I'm pretty sure I've seen this issue on ubuntu.
Comment #11
johnnny83 commentedComment #12
jjancel commentedI have the same problem with microsoft servers, while everything works well under linux
Comment #13
bohus ulrychHi,
if you are facing with thumbnails generating on Windows then really check #2858308: File paths are written to the DB with back slashes on Windows servers
P.S. This ticket title (...no images styles are created) is more corresponding to the real issue than #2858308 title.
Comment #14
johnnny83 commentedI'm still having this issue on Linux, so I can't use File (Field) Paths
Comment #15
jay.lee.bio commentedFor me, this issue only happened for the first image. But #6 in issue #2858308 took care of it.
Comment #16
mehrdad201 commentedI have the same problems
image styles are not created when I use file field path in my Drupal 8.
I have tested both filefield_paths-8.x-1.0-beta5.tar.gz and filefield_paths-8.x-1.x-dev.tar.gz versions.
Even though beta5 is released on December 1, 2020 (7 days ago), the problem still exists.
I found no patch to get rid of this problem.
Comment #19
volegerIntroduced test
\Drupal\Tests\filefield_paths\Functional\FileFieldPathsGeneralTest::testImageStyleDerivativeGenerationwhich checks the Image style URL and file presence in the filesystem by URI.Feel free to reopen as a new issue, and describe the steps to reproduce if the problem persists.