Commit 68b62299 authored by Robert Lyon's avatar Robert Lyon

Fix quota update on group file upload (Bug #1479178)

There was a problem with group update where the group quota data was not
getting updated when uploading a file due to caching.

Change-Id: I96ee13b39d815c126f3ff1689f413eb20b0f1c76
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent c160ff3a
...@@ -987,7 +987,7 @@ function pieform_element_filebrowser_upload(Pieform $form, $element, $data) { ...@@ -987,7 +987,7 @@ function pieform_element_filebrowser_upload(Pieform $form, $element, $data) {
$result['uploaded'] = true; $result['uploaded'] = true;
$result['newlist'] = pieform_element_filebrowser_build_filelist($form, $element, $parentfolder, $newid); $result['newlist'] = pieform_element_filebrowser_build_filelist($form, $element, $parentfolder, $newid);
if (defined('GROUP')) { if (defined('GROUP')) {
$group = group_current_group(); $group = group_current_group(false);
$result['quota'] = $group->quota; $result['quota'] = $group->quota;
$result['quotaused'] = $group->quotaused; $result['quotaused'] = $group->quotaused;
} }
......
...@@ -1834,11 +1834,15 @@ function group_param_userid($userid) { ...@@ -1834,11 +1834,15 @@ function group_param_userid($userid) {
return $userid; return $userid;
} }
/**
function group_current_group() { * Fetch the current group
*
* @param string $cache Set to false to override cache
*/
function group_current_group($cache=true) {
static $group; static $group;
if (isset($group)) { if (isset($group) && $cache) {
return $group; return $group;
} }
......
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