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:
Jan Böhmer 2024-12-31 18:25:28 +01:00
parent 273bde90f2
commit c9e519d0b5
2 changed files with 10 additions and 0 deletions

View file

@ -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,
]);