* All apps/PostgreSQL: fix SQL error when deleting an entry without attachments

This commit is contained in:
Ralf Becker 2017-12-07 17:16:46 +08:00
parent 93353a55c0
commit 4a13fb4c21

View File

@ -280,6 +280,30 @@ class StreamWrapper extends LinksParent
return $ret;
}
/**
* This method is called in response to rmdir() calls on URL paths associated with the wrapper.
*
* Reimplemented to do nothing (specially not complain), if an entry directory does not exist,
* as we always report them as existing!
*
* @param string $url
* @param int $options Possible values include STREAM_REPORT_ERRORS.
* @return boolean TRUE on success or FALSE on failure.
*/
function rmdir ( $url, $options )
{
$path = $url != '/' ? Vfs::parse_url($url,PHP_URL_PATH) : $url;
list(,/*$apps*/,/*$app*/,/*$id*/,$rest) = explode('/',$path);
// never delete entry-dir, as it makes attic inaccessible
if (empty($rest))
{
return true;
}
return parent::rmdir( $path, $options );
}
/**
* This method is called immediately after your stream object is created.
*