Filemanager: Fix change in ownership of sub-directories did not always update UI

This commit is contained in:
nathangray 2021-03-29 15:56:00 -06:00
parent 8f1383b973
commit b16ccfd3ef

View File

@ -1264,6 +1264,7 @@ class filemanager_ui
static $name2cmd = array('uid' => 'chown','gid' => 'chgrp','perms' => 'chmod'); static $name2cmd = array('uid' => 'chown','gid' => 'chgrp','perms' => 'chmod');
$cmd = array('EGroupware\\Api\\Vfs',$name2cmd[$name]); $cmd = array('EGroupware\\Api\\Vfs',$name2cmd[$name]);
$value = $name == 'perms' ? static::perms2mode($content['perms']) : $content[$name]; $value = $name == 'perms' ? static::perms2mode($content['perms']) : $content[$name];
if(!$value) continue;
if ($content['modify_subs']) if ($content['modify_subs'])
{ {
if ($name == 'perms') if ($name == 'perms')
@ -1276,11 +1277,14 @@ class filemanager_ui
$changed = Vfs::find($path,null,$cmd,array($value)); $changed = Vfs::find($path,null,$cmd,array($value));
} }
$ok = $failed = 0; $ok = $failed = 0;
foreach($changed as &$r) foreach($changed as $sub_path => &$r)
{ {
if ($r) if ($r)
{ {
++$ok; ++$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 else
{ {