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

View file

@ -12257,5 +12257,11 @@ Please note, that you can not impersonate a disabled user. If you try you will g
<target>Update existing part from info provider</target>
</segment>
</unit>
<unit id="X5tEZJs" name="part.create_from_info_provider.no_category_yet">
<segment>
<source>part.create_from_info_provider.no_category_yet</source>
<target>Category could not be automatically determined by the info provider. Review the data and select the category manually.</target>
</segment>
</unit>
</file>
</xliff>