mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 00:43:20 +01:00
* All apps: fixed moving attachments to new entries (without attachments) lost moved file
This commit is contained in:
parent
719d787ce3
commit
e613c59dc3
@ -397,6 +397,31 @@ class StreamWrapper extends LinksParent
|
||||
return is_null($time) ? true : parent::touch($url,$time,$atime);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called in response to rename() calls on URL paths associated with the wrapper.
|
||||
*
|
||||
* Reimplemented to create the entry directory, in case it's only faked to be there.
|
||||
*
|
||||
* @param string $path_from
|
||||
* @param string $path_to
|
||||
* @return boolean TRUE on success or FALSE on failure
|
||||
*/
|
||||
function rename ( $path_from, $path_to )
|
||||
{
|
||||
if (self::LOG_LEVEL > 1) error_log(__METHOD__."($path_from,$path_to)");
|
||||
|
||||
// Check to make sure target _really_ exists, not just fake dir from Links/StreamWrapper
|
||||
$path = Vfs::parse_url($path_to, PHP_URL_PATH);
|
||||
list(,/*$apps*/,/*$app*/,$id) = explode('/', $path);
|
||||
|
||||
if($id && !parent::url_stat(Vfs::dirname($path_to),STREAM_URL_STAT_QUIET))
|
||||
{
|
||||
$this->mkdir(Vfs::dirname($path), 0, STREAM_MKDIR_RECURSIVE );
|
||||
}
|
||||
|
||||
return parent::rename($path_from,$path_to);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register this stream-wrapper
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user