mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Adapter attachment upload forms to the new system
This commit is contained in:
parent
0c33059c4e
commit
3585b8a56a
7 changed files with 32 additions and 22 deletions
|
@ -24,6 +24,7 @@ namespace App\Controller\AdminPages;
|
|||
|
||||
use App\DataTables\LogDataTable;
|
||||
use App\Entity\Attachments\Attachment;
|
||||
use App\Entity\Attachments\AttachmentUpload;
|
||||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\Base\AbstractNamedDBElement;
|
||||
use App\Entity\Base\AbstractPartsContainingDBElement;
|
||||
|
@ -175,16 +176,10 @@ abstract class BaseAdminController extends AbstractController
|
|||
$attachments = $form['attachments'];
|
||||
foreach ($attachments as $attachment) {
|
||||
/** @var FormInterface $attachment */
|
||||
$options = [
|
||||
'secure_attachment' => $attachment['secureFile']->getData(),
|
||||
'download_url' => $attachment['downloadURL']->getData(),
|
||||
];
|
||||
|
||||
try {
|
||||
$this->attachmentSubmitHandler->handleFormSubmit(
|
||||
$this->attachmentSubmitHandler->handleUpload(
|
||||
$attachment->getData(),
|
||||
$attachment['file']->getData(),
|
||||
$options
|
||||
AttachmentUpload::fromAttachmentForm($attachment)
|
||||
);
|
||||
} catch (AttachmentDownloadException $attachmentDownloadException) {
|
||||
$this->addFlash(
|
||||
|
@ -270,10 +265,9 @@ abstract class BaseAdminController extends AbstractController
|
|||
];
|
||||
|
||||
try {
|
||||
$this->attachmentSubmitHandler->handleFormSubmit(
|
||||
$this->attachmentSubmitHandler->handleUpload(
|
||||
$attachment->getData(),
|
||||
$attachment['file']->getData(),
|
||||
$options
|
||||
AttachmentUpload::fromAttachmentForm($attachment)
|
||||
);
|
||||
} catch (AttachmentDownloadException $attachmentDownloadException) {
|
||||
$this->addFlash(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue