mirror of
https://github.com/nextcloud/server.git
synced 2026-03-28 13:23:49 -04:00
fix webdav errors for empty folders
This commit is contained in:
parent
060a297260
commit
420d23a875
1 changed files with 11 additions and 9 deletions
|
|
@ -90,16 +90,18 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
|
|||
foreach($folder_content as $info) {
|
||||
$paths[] = $this->path.'/'.$info['name'];
|
||||
}
|
||||
$placeholders = join(',', array_fill(0, count($paths), '?'));
|
||||
$query = OC_DB::prepare( 'SELECT * FROM *PREFIX*properties WHERE userid = ?' . ' AND propertypath IN ('.$placeholders.')' );
|
||||
array_unshift($paths, OC_User::getUser()); // prepend userid
|
||||
$result = $query->execute( $paths );
|
||||
$properties = array_fill_keys($paths, array());
|
||||
while($row = $result->fetchRow()) {
|
||||
$propertypath = $row['propertypath'];
|
||||
$propertyname = $row['propertyname'];
|
||||
$propertyvalue = $row['propertyvalue'];
|
||||
$properties[$propertypath][$propertyname] = $propertyvalue;
|
||||
if(count($paths)>0){
|
||||
$placeholders = join(',', array_fill(0, count($paths), '?'));
|
||||
$query = OC_DB::prepare( 'SELECT * FROM *PREFIX*properties WHERE userid = ?' . ' AND propertypath IN ('.$placeholders.')' );
|
||||
array_unshift($paths, OC_User::getUser()); // prepend userid
|
||||
$result = $query->execute( $paths );
|
||||
while($row = $result->fetchRow()) {
|
||||
$propertypath = $row['propertypath'];
|
||||
$propertyname = $row['propertyname'];
|
||||
$propertyvalue = $row['propertyvalue'];
|
||||
$properties[$propertypath][$propertyname] = $propertyvalue;
|
||||
}
|
||||
}
|
||||
|
||||
$nodes = array();
|
||||
|
|
|
|||
Loading…
Reference in a new issue