Breaking this off from #1191236: Correct file_copy, file_move, file_save_data, and drupal_realpath to match documentation and their unmanaged counterparts.
The documentation for the $destination parameter to file_move() says, in part:
If this value is omitted, Drupal's default files scheme will be used, usually "public://".
However, this claim is untrue. Omitting the $destination parameter will actually result in the following code being executed:
watchdog('file', 'File %file (%realpath) could not be moved, because the destination %destination is invalid. This may be caused by improper use of file_move() or a missing stream wrapper.', array('%file' => $source->uri, '%realpath' => drupal_realpath($source->uri), '%destination' => $destination));
drupal_set_message(t('The specified file %file could not be moved, because the destination is invalid. More information is available in the system log.', array('%file' => $source->uri)), 'error');
return FALSE;
Comments
Comment #1
pillarsdotnet commentedPatch fixes code to match docs.
Comment #3
pillarsdotnet commentedComment #4
pillarsdotnet commentedComment #5
pillarsdotnet commentedComment #6
pillarsdotnet commentedDuplicate of #1192456: Make docs of file_move() match code.