mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 12:18:54 +02:00
Fixed phpunit tests for postgres
This commit is contained in:
parent
07f1ce5822
commit
33a5e70b70
2 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue