Compare commits

..

12 Commits

Author SHA1 Message Date
Jan Böhmer
98b8c5b788 Bump to version 2.3.0 2025-12-07 22:47:59 +01:00
Jan Böhmer
e0feda4e46 Fixed 2DA login
Fixes issue #1141
2025-12-07 22:47:27 +01:00
Jan Böhmer
9565a9d548 Fixed error with mass creation, when elements on different level had the same name
Fixes issue #1104
2025-12-07 21:40:57 +01:00
Jan Böhmer
b457298152 Do not clear the mass import form if errors appeared 2025-12-07 21:33:41 +01:00
Jan Böhmer
319ac406a8 Update the mass creation form, so that you can see the newly created entities in dropdown
Fixes issue #1103
2025-12-07 20:50:09 +01:00
Jan Böhmer
065396d1e9 Correctly determine the number of mass created entities
Fixes issue #1102
2025-12-07 20:44:32 +01:00
Jan Böhmer
15243dbcc8 Allow to autodetermine categories and pathes from info provider import using a full path
This fixes issue #1113
2025-12-07 20:39:03 +01:00
Jan Böhmer
e1090d46e3 Fixed error that attachment path had to have exactly 2048 chars 2025-12-07 20:34:47 +01:00
Jan Böhmer
8d903c9586 Merge remote-tracking branch 'origin/master' 2025-12-07 20:25:45 +01:00
Jan Böhmer
39ff4f81c0 Use image attachments as preview images for partkeepr imports
Fixes issue #1115
2025-12-07 20:25:39 +01:00
Jan Böhmer
c60b406157 Fixed partkeepr import with databases that do not feature custom states 2025-12-07 20:21:19 +01:00
Copilot
a66a1b1c33 Document KiCad's rejection of self-signed certificates (#1140)
* Initial plan

* Add documentation about KiCad self-signed certificate issues

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
2025-12-07 19:31:16 +01:00
9 changed files with 37 additions and 7 deletions

View File

@@ -1 +1 @@
2.2.1
2.3.0

View File

@@ -1,7 +1,7 @@
framework:
default_locale: 'en'
# Just enable the locales we need for performance reasons.
enabled_locale: ['en', 'de', 'it', 'fr', 'ru', 'ja', 'cs', 'da', 'zh', 'pl']
enabled_locale: '%partdb.locale_menu%'
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:

View File

@@ -366,6 +366,14 @@ abstract class BaseAdminController extends AbstractController
}
}
//Count how many actual new entities were created (id is null until persisted)
$created_count = 0;
foreach ($results as $result) {
if (null === $result->getID()) {
$created_count++;
}
}
//Persist valid entities to DB
foreach ($results as $result) {
$em->persist($result);
@@ -373,8 +381,14 @@ abstract class BaseAdminController extends AbstractController
$em->flush();
if (count($results) > 0) {
$this->addFlash('success', t('entity.mass_creation_flash', ['%COUNT%' => count($results)]));
$this->addFlash('success', t('entity.mass_creation_flash', ['%COUNT%' => $created_count]));
}
if (count($errors)) {
//Recreate mass creation form, so we get the updated parent list and empty lines
$mass_creation_form = $this->createForm(MassCreationForm::class, ['entity_class' => $this->entity_class]);
}
}
return $this->render($this->twig_template, [

View File

@@ -169,7 +169,7 @@ abstract class Attachment extends AbstractNamedDBElement
#[ORM\Column(type: Types::STRING, length: 2048, nullable: true)]
#[Groups(['attachment:read'])]
#[ApiProperty(example: 'http://example.com/image.jpg')]
#[Assert\Length(2048)]
#[Assert\Length(max: 2048)]
protected ?string $external_path = null;
/**

View File

@@ -243,6 +243,14 @@ class StructuralDBElementRepository extends AttachmentContainingDBElementReposit
return $result[0];
}
//If the name contains category delimiters like ->, try to find the element by its full path
if (str_contains($name, '->')) {
$tmp = $this->getEntityByPath($name, '->');
if (count($tmp) > 0) {
return $tmp[count($tmp) - 1];
}
}
//If we find nothing, return null
return null;
}

View File

@@ -167,7 +167,7 @@ class EntityImporter
}
//Only return objects once
return array_values(array_unique($valid_entities));
return array_values(array_unique($valid_entities, SORT_REGULAR));
}
/**

View File

@@ -152,7 +152,7 @@ class PKDatastructureImporter
public function importPartCustomStates(array $data): int
{
if (!isset($data['partcustomstate'])) {
throw new \RuntimeException('$data must contain a "partcustomstate" key!');
return 0; //Not all PartKeepr installations have custom states
}
$partCustomStateData = $data['partcustomstate'];

View File

@@ -150,6 +150,11 @@ trait PKImportHelperTrait
$target->addAttachment($attachment);
$this->em->persist($attachment);
//If the attachment is an image, and the target has no master picture yet, set it
if ($attachment->isPicture() && $target->getMasterPictureAttachment() === null) {
$target->setMasterPictureAttachment($attachment);
}
}
$this->em->flush();

View File

@@ -91,7 +91,10 @@ class PKPartImporter
$this->setAssociationField($entity, 'partUnit', MeasurementUnit::class, $part['partUnit_id']);
}
$this->setAssociationField($entity, 'partCustomState', MeasurementUnit::class, $part['partCustomState_id']);
if (isset($part['partCustomState_id'])) {
$this->setAssociationField($entity, 'partCustomState', MeasurementUnit::class,
$part['partCustomState_id']);
}
//Create a part lot to store the stock level and location
$lot = new PartLot();