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.
When using devel_generate, I get the following error when generating nodes with attached images stored in Storage API containers:
Missing argument 2 for DrupalStorageStreamWrapper::url_stat()
I'll attach a quick and dirty patch to tide me over. I think the proper fix should probably happen in devel_generate instead.
Comment | File | Size | Author |
---|---|---|---|
#10 | storage-api-1899016.patch | 672 bytes | jonhattan |
#7 | storage_api-n1899016-7.patch | 516 bytes | DamienMcKenna |
Comments
Comment #1
wulff CreditAttribution: wulff commented...and the patch.
Comment #2
30equals CreditAttribution: 30equals commentedI saw the same problem, but for what it's worth, i'd fix it where the function get's called, instead of giving a default value - just to maintain consistency with the main Class ?
Comment #3
wulff CreditAttribution: wulff commentedHm. I still think it would make sense to fix it in Storage API according to the definition of url_stat on http://www.php.net/manual/en/class.streamwrapper.php.
Comment #4
Perignon CreditAttribution: Perignon commentedThis is an old issue. Is it still valid?
Comment #5
Silicon.Valet CreditAttribution: Silicon.Valet commentedYes. http://cgit.drupalcode.org/storage_api/tree/core_bridge/storage_core_bri...
Patch works as described.
Comment #6
Perignon CreditAttribution: Perignon commentedComment #7
DamienMcKennaThere's no point in keeping the argument because it isn't actually used in the method.
Comment #8
jonhattanThe method should at least test STREAM_URL_STAT_QUIET flag and behave in consecuence (do not raise an exception). It is already implemented in the storage_api_stream_wrapper module - http://cgit.drupalcode.org/storage_api_stream_wrapper/tree/StorageApiStr...
Comment #9
DamienMcKenna@jonhattan: Could you please update the patch with at least some comments or pseudocode on what you should it should be? I've not looked at Storage API before so have absolutely no clue :)
Comment #10
jonhattanCommitting attached patch.
Just realized I'm a maintainer of this module! Thanks!? @Perignon :D
Comment #11
Perignon CreditAttribution: Perignon commented;-) I appreciate the help a lot!
Comment #13
jonhattanComment #14
Perignon CreditAttribution: Perignon commentedI will try and keep the Github and Bitbucket repo's up to date.
Comment #15
DamienMcKennaBut that's a workaround rather than an actual fix for the simple problem that a required variable in the method isn't actually used.
Comment #16
jonhattanWe loose the focus here.
class DrupalStorageStreamWrapper implements DrupalStreamWrapperInterface
,DrupalStreamWrapperInterface extends StreamWrapperInterface
.StreamWrapperInterface
is a Drupal class that provides an interface for the PHP prototype of a stream wrapper class - http://www.php.net/manual/en/class.streamwrapper.phpSo we want to follow the interfaces signature:
public function url_stat($uri, $flags);
, and thus we need to pass a value for flags in all of our calls.Comment #18
jonhattan