[PLUGIN][AttachmentCollections] Fixing forms submission
This commit is contained in:
parent
72a19d7eac
commit
672df5165c
|
@ -33,6 +33,7 @@ namespace Plugin\AttachmentCollections;
|
|||
|
||||
use App\Core\DB\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Exception\RedirectException;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Plugin;
|
||||
|
@ -172,6 +173,7 @@ class AttachmentCollections extends Plugin
|
|||
}
|
||||
}
|
||||
DB::flush();
|
||||
throw new RedirectException();
|
||||
}
|
||||
// add to new collection form
|
||||
$create_form = Form::create([
|
||||
|
@ -204,6 +206,7 @@ class AttachmentCollections extends Plugin
|
|||
'collection_id' => $coll->getId(),
|
||||
]));
|
||||
DB::flush();
|
||||
throw new RedirectException();
|
||||
}
|
||||
|
||||
$res[] = Formatting::twigRenderFile(
|
||||
|
|
|
@ -24,6 +24,7 @@ declare(strict_types = 1);
|
|||
namespace Plugin\AttachmentCollections\Controller;
|
||||
|
||||
use App\Core\DB\DB;
|
||||
use App\Core\Exception\RedirectException;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Router\Router;
|
||||
|
@ -86,6 +87,7 @@ class Controller extends FeedController
|
|||
'actor_id' => $id,
|
||||
]));
|
||||
DB::flush();
|
||||
throw new RedirectException();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,6 +152,7 @@ class Controller extends FeedController
|
|||
$collection->setName($edit->getData()['name']);
|
||||
DB::persist($collection);
|
||||
DB::flush();
|
||||
throw new RedirectException();
|
||||
}
|
||||
return $edit->createView();
|
||||
}
|
||||
|
@ -169,6 +172,7 @@ class Controller extends FeedController
|
|||
if ($rm->isSubmitted()) {
|
||||
DB::remove($collection);
|
||||
DB::flush();
|
||||
throw new RedirectException();
|
||||
}
|
||||
return $rm->createView();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user