is_file() and file_exists() return false on public stream uri

Created on 29 July 2021, almost 3 years ago
Updated 31 January 2023, over 1 year ago

Problem/Motivation

When executing is_file() or file_exists() on a public stream uri, the file doesn't exist because it gets checked for local existence instead of remote.

Steps to reproduce

  1. Install stage_file_proxy 1.1 and blazy 2.4 in a D8 or D9 project.
  2. Set up a Blazy image formatter on a node image field.
  3. Create content using the image field and view the content, the image is not loading.

In my case it is the is_file() function called in web/modules/contrib/blazy/src/BlazyManager.php, line 49.

Proposed resolution

I tried the stage_file_proxy stream wrapper ( #2928564 ✨ Add stage_file_proxy stream wrapper Needs work ) but without luck. No solution yet.

Remaining tasks

Find a solution for using is_file() and file_exists() in combination with stage_file_proxy.

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium Fernly

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024