mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Apply fix to query idInsideBundle for documentCategory creation
This commit is contained in:
parent
9e3431f397
commit
d0fa6dd512
@ -92,13 +92,14 @@ class DocumentCategoryController extends AbstractController
|
||||
|
||||
$nextId = $em
|
||||
->createQuery(
|
||||
'SELECT MAX(c.idInsideBundle) + 1 FROM ChillDocStoreBundle:DocumentCategory c'
|
||||
'SELECT (CASE WHEN MAX(c.idInsideBundle) IS NULL THEN 1 ELSE MAX(c.idInsideBundle) + 1 END)
|
||||
FROM ChillDocStoreBundle:DocumentCategory c'
|
||||
)
|
||||
->getSingleResult();
|
||||
->getSingleScalarResult();
|
||||
|
||||
$documentCategory = new DocumentCategory(
|
||||
ChillDocStoreBundle::class,
|
||||
reset($nextId)
|
||||
$nextId
|
||||
);
|
||||
|
||||
$documentCategory
|
||||
|
Loading…
x
Reference in New Issue
Block a user