From b16ccfd3ef12081e96dd0edc50c59d2cf3c2de55 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 29 Mar 2021 15:56:00 -0600 Subject: [PATCH] Filemanager: Fix change in ownership of sub-directories did not always update UI --- filemanager/inc/class.filemanager_ui.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index e32898bb77..ef03ce3063 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -1264,6 +1264,7 @@ class filemanager_ui static $name2cmd = array('uid' => 'chown','gid' => 'chgrp','perms' => 'chmod'); $cmd = array('EGroupware\\Api\\Vfs',$name2cmd[$name]); $value = $name == 'perms' ? static::perms2mode($content['perms']) : $content[$name]; + if(!$value) continue; if ($content['modify_subs']) { if ($name == 'perms') @@ -1276,11 +1277,14 @@ class filemanager_ui $changed = Vfs::find($path,null,$cmd,array($value)); } $ok = $failed = 0; - foreach($changed as &$r) + foreach($changed as $sub_path => &$r) { if ($r) { ++$ok; + // Changing owner does not change mtime. Clear subs on UI so they get reloaded + if($sub_path == $path) continue; + Api\Json\Response::get()->apply('egw.dataStoreUID',['filemanager::'.$sub_path,null]); } else {