Commit 03a0482f authored by Antti Koskinen's avatar Antti Koskinen Committed by Richard Mansfield
Browse files

Fix file browsing when adding file blocks to group views (bug #634835)

parent 26a69801
......@@ -207,10 +207,15 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h
global $USER;
$smarty = smarty_core();
$userid = null;
if (is_null($group) && is_null($user)) {
$group = $form->get_property('group');
}
else if ($user) {
$userid = $USER->get('id');
$smarty->assign('owner', 'user');
$smarty->assign('ownerid', $userid);
}
else {
$smarty->assign('owner', 'group');
$smarty->assign('ownerid', $group);
......@@ -222,7 +227,10 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h
$smarty->assign('owner', 'institution');
$smarty->assign('ownerid', $institution);
}
$userid = ($group || $institution) ? null : $USER->get('id');
if (is_null($userid)) {
$userid = ($group || $institution) ? null : $USER->get('id');
}
$editable = (int) $element['config']['edit'];
$selectable = (int) $element['config']['select'];
$selectfolders = (int) !empty($element['config']['selectfolders']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment