Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello there, I am trying to print links via file_create_url($uri) and unfortunately, this breaks occasionally when using Storage API. The function will return a non-existant local path after Cron has moved the files to a remote storage and thus confront the end-user with a 404 error.
After changing the display method of the container (Serve by redirection to Serve source URL and vice versa), the error is gone but will sporadically re-appear with new files.
What could be the reason for this and how can we fix it?
Comments
Comment #1
30equals CreditAttribution: 30equals commentedYup, got the same problem.
For instance, when using the FTP class, the upload to a subfolder works. But when the image needs to get displayed, it returns the path without any subfolders, so the file doesn't get found..
Comment #2
wmnnd CreditAttribution: wmnnd commentedjbrown, could you maybe comment on this?
Comment #3
jbrown CreditAttribution: jbrown commentedWhich uri are you passing to file_create_url()?
Comment #4
wmnnd CreditAttribution: wmnnd commentedWell, the uri that is provided by the field, i. e. $item['#item']['uri']
Comment #5
Perignon CreditAttribution: Perignon commentedWas this resolved? I am trying to get a clean slate on the issue queue for this module. If this was not resolved, please reopen the issue.