This issue is identical to:

https://www.drupal.org/project/stage_file_proxy/issues/3293275

The issue with trim() was fixed in src/EventSubscriber/ProxySubscriber.php but not in src/EventSubscriber/StageFileProxySubscriber.php

However ProxySubscriber is deprecated from 2.1.0 onwards so StageFileProxySubscriber needs the same fix.

CommentFileSizeAuthor
#7 3378374-07.patch886 bytesjschref
Command icon 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

ThomWilhelm created an issue. See original summary.

thomwilhelm’s picture

Assigned: thomwilhelm » Unassigned
Status: Active » Needs review
thomwilhelm’s picture

Title: PHP 8.1 Deprecated function: trim(): Passing null to parameter #1 » StageFileProxySubscriber - PHP 8.1 Deprecated function: trim(): Passing null to parameter #1
Issue summary: View changes
keshavv’s picture

I have checked the MR and found that it is a config variable and it will never be null. As the default value is already provided in config/install/stage_file_proxy.settings.yml.

thomwilhelm’s picture

Oh that's interesting as I only stumbled across this as I got this warning on one of our sites. I'll do some more digging.

jschref’s picture

StatusFileSize
new886 bytes

FWIW, I ran into this intermittently too. Converted this to a patch in case anyone else needs it as well.

thomwilhelm’s picture

Status: Needs review » Closed (works as designed)

Comment #5 you were correct!

I realised I had a broken config_split setup, so I had missed the schema update when upgrading at some stage.

After fixing my config_split setup, I uninstalled stage_file_proxy, then re-installed and configured the form again from scratch. After exporting dev config, I can see the origin_dir setting. So there is no need for this patch, I'll close the MR.