When trying to adopt a module to D7 i ran into the issue that system_retrieve_file() was causing file_unmanaged_copy to fail with a message that it could not copy to the given destination - which was a plain filesystem path, without stream wrapper stream. This patch clarifies the function documentations in file.inc to explicitly state that a stream wrapper is mandatory.

Comments

eMPee584’s picture

Issue tags: +Documentation

(tagging..)

cburschka’s picture

Status: Needs review » Needs work
+++ includes/file.inc
@@ -513,8 +513,8 @@ function file_save(stdClass $file) {
+ *   This must be a stream wrapper URI. If this value is omitted, Drupal's
+ *   default files scheme will be used, usually "public://".

This sounds a bit ambiguous. A "files scheme" is not a destination - does this mean the root folder of public://? The same applies to the rest.

This review is powered by Dreditor.

drewish’s picture

Status: Needs work » Needs review

I agree that it's not perfect but since even should->must is such a clear improvement we should go ahead and commit this. Resetting the status to test that the patch still applies.

drewish’s picture

Component: base system » file system
dman’s picture

Yeah. A bit repetitive when looked at as a patch, but any clearer instructions here are good. I'm getting bitten by this too :-}
+1

eMPee584’s picture

Status: Needs review » Reviewed & tested by the community

well.. factual correctness over linguistic beauty ;)

eMPee584’s picture

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Cool. Nothing wrong with clarifying documentation. :)

Committed to HEAD!

Status: Fixed » Closed (fixed)
Issue tags: -Documentation

Automatically closed -- issue fixed for 2 weeks with no activity.