mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-15 12:54:30 +02:00
Show a warning flash, when creating a part from an info provider that has no category autoprovided
This partially fixes the problems described in discussion #808
This commit is contained in:
parent
273bde90f2
commit
c9e519d0b5
2 changed files with 10 additions and 0 deletions
|
@ -229,6 +229,10 @@ class PartController extends AbstractController
|
|||
$dto = $infoRetriever->getDetails($providerKey, $providerId);
|
||||
$new_part = $infoRetriever->dtoToPart($dto);
|
||||
|
||||
if ($new_part->getCategory() === null || $new_part->getCategory()->getID() === null) {
|
||||
$this->addFlash('warning', t("part.create_from_info_provider.no_category_yet"));
|
||||
}
|
||||
|
||||
return $this->renderPartForm('new', $request, $new_part, [
|
||||
'info_provider_dto' => $dto,
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue