Commit 13b57e36 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Display the correct folder's listing after changing folder

parent 646a1c78
......@@ -243,7 +243,7 @@ function pieform_element_filebrowser_doupdate(Pieform $form, $element) {
'folder' => $folder,
));
}
else if (!empty($_POST['upload']) || ($_FILES['userfile'] && $_FILES['userfile']['name'])) {
else if (!empty($_POST['upload']) || (isset($_FILES['userfile']))) {
if (!isset($_FILES['userfile']['name'])) {
return array(
'error' => true,
......@@ -265,7 +265,9 @@ function pieform_element_filebrowser_doupdate(Pieform $form, $element) {
}
else if (!empty($_POST['changefolder']) && is_array($_POST['changefolder'])) {
$keys = array_keys($_POST['changefolder']);
$result = pieform_element_filebrowser_changefolder($form, $element, (int) $keys[0]);
$newfolder = (int) $keys[0];
$result = pieform_element_filebrowser_changefolder($form, $element, $newfolder);
$folder = $newfolder;
}
if (is_array($result) && $form->submitted_by_js()) {
......
Supports Markdown
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