mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-02-16 11:37:47 +01:00
Fixed a bug when deleting files via AJAX
This commit is contained in:
@@ -882,13 +882,10 @@ class AdminPlugin extends Plugin
|
||||
|
||||
public function onOutputGenerated()
|
||||
{
|
||||
// Clear flash objects for previously uploaded files
|
||||
// whenever the user switches page / reloads
|
||||
// Clear flash objects for previously uploaded files whenever the user switches page or reloads
|
||||
// ignoring any JSON / extension call
|
||||
if ($this->admin->task !== 'save' && empty($this->uri->extension())) {
|
||||
// Discard any previously uploaded files session.
|
||||
// and if there were any uploaded file, remove them from the filesystem
|
||||
// FIXME:
|
||||
// Discard any previously uploaded files session and remove all uploaded files.
|
||||
if ($flash = $this->session->getFlashObject('files-upload')) {
|
||||
$flash = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($flash));
|
||||
foreach ($flash as $key => $value) {
|
||||
|
||||
Reference in New Issue
Block a user