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.
Simple fix, makes this function also usable with stream wrapper URIs.
Comment | File | Size | Author |
---|---|---|---|
#12 | dont-resolve-streamwrapper-before-delete.patch | 958 bytes | jbrown |
#3 | file-inc-file_unmanaged_delete-recursive--handle-stream-wrappers.patch | 1.58 KB | eMPee584 |
file-inc-file_unmanaged_delete-handle-stream-wrappers.patch | 816 bytes | eMPee584 | |
Comments
Comment #1
eMPee584 CreditAttribution: eMPee584 commented(tagging)
Comment #2
sunThe same also for file_unmanaged_delete_recursive(), please.
Comment #3
eMPee584 CreditAttribution: eMPee584 commentednp but still doubtful about the last doc change, is that *really* better English ?*g
Comment #4
sunThe recursive function invokes itself recursive - does that work with drupal_realpath()?
Comment #5
eMPee584 CreditAttribution: eMPee584 commentedYes all test cases passing.. there might be a few CPU instructions to save doing
or not, don't think that's better though.
Comment #6
sunThe more I look into the local stream wrapper classes, the more I'm unsure whether these two functions aren't properly supporting streams already (so this would be a documentation-only issue). Are you sure?
If they really do not, then I guess we just have to instantiate proper stream wrappers instead of assuming all unmanaged files are local.
See also:
- http://php.net/manual/en/wrappers.file.php
- http://php.net/manual/en/streamwrapper.unlink.php
Comment #7
eMPee584 CreditAttribution: eMPee584 commentedYES, i tried and it did not work. That's the point *g
Comment #8
drewish CreditAttribution: drewish commentedi didn't apply this but the changes look sane.
Comment #9
sunTagging absolutely critical clean-ups for D7. Do not touch this tag. Please either help with this or one of the other patches having this tag.
Comment #10
webchickThis looks like a good change. Committed to HEAD. Thanks!
Comment #12
jbrown CreditAttribution: jbrown commentedThis patch was incorrect - it is up to the streamwrapper to delete the underlying file.
Currently, the only way for remote streamwrappers to be able delete a file is if they return the full URI from DrupalStreamWrapperInterface::realpath().
Comment #13
jbrown CreditAttribution: jbrown commentedComment #14
jbrown CreditAttribution: jbrown commented#1083982: Fix support for remote streamwrappers
Comment #15
gisleRemoving non-canonical duplicate tag. See #2426171: Multiple tags similar to 'API clean-up' for background.