Commit d2b9e161 authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Undefined index: 'tabs' warning after editing a file or folder (Bug



Check the availability of $element['tabs'] before access it.
Remove the variable $folder as it isn't used anywhere.

Change-Id: I9a9f797f63c9904e10c4b6a6ba60505407464c11
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 2531a415
......@@ -1036,22 +1036,21 @@ function pieform_element_filebrowser_update(Pieform $form, $element, $data) {
$group = null;
$institution = null;
$user = null;
$folder = 0;
if ($newtabdata['owner'] == 'site') {
global $USER;
if (!$USER->get('admin')) {
$folder = ArtefactTypeFolder::admin_public_folder_id();
if (!empty($element['tabs'])) {
$newtabdata = pieform_element_filebrowser_configure_tabs($element['tabs'], $prefix);
if ($newtabdata['owner'] == 'site') {
$institution = 'mahara';
}
else if ($newtabdata['owner'] == 'institution') {
$institution = $newtabdata['ownerid'];
}
else if ($newtabdata['owner'] == 'group') {
$group = $newtabdata['ownerid'];
}
else if ($newtabdata['owner'] == 'user') {
$user = true;
}
$institution = 'mahara';
}
else if ($newtabdata['owner'] == 'institution') {
$institution = $newtabdata['ownerid'];
}
else if ($newtabdata['owner'] == 'group') {
$group = $newtabdata['ownerid'];
}
else if ($newtabdata['owner'] == 'user') {
$user = true;
}
$returndata = array(
......
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