mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +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);
|
$dto = $infoRetriever->getDetails($providerKey, $providerId);
|
||||||
$new_part = $infoRetriever->dtoToPart($dto);
|
$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, [
|
return $this->renderPartForm('new', $request, $new_part, [
|
||||||
'info_provider_dto' => $dto,
|
'info_provider_dto' => $dto,
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -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>
|
<target>Update existing part from info provider</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</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>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue