Fixed phpunit tests for postgres

This commit is contained in:
Jan Böhmer 2024-06-13 22:19:17 +02:00
parent 07f1ce5822
commit 33a5e70b70
2 changed files with 7 additions and 1 deletions

View file

@ -207,6 +207,11 @@ class ProjectController extends AbstractController
//Preset the BOM entries with the selected parts, when the form was not submitted yet
$preset_data = new ArrayCollection();
foreach (explode(',', (string) $request->get('parts', '')) as $part_id) {
//Skip empty part IDs. Postgres seems to be especially sensitive to empty strings, as it does not allow them in integer columns
if ($part_id === '') {
continue;
}
$part = $entityManager->getRepository(Part::class)->find($part_id);
if (null !== $part) {
//If there is already a BOM entry for this part, we use this one (we edit it then)