mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-09 01:09:51 +00:00
Merge branch '354-fix_creation_document_category' into 'master'
Resolve "chill_doc: cannot create a document category" Closes #354 See merge request Chill-Projet/chill-bundles!791
This commit is contained in:
commit
cc150e32f0
6
.changes/unreleased/Fixed-20250203-112259.yaml
Normal file
6
.changes/unreleased/Fixed-20250203-112259.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: Fix document category creation
|
||||||
|
time: 2025-02-03T11:22:59.977168975+01:00
|
||||||
|
custom:
|
||||||
|
Issue: "354"
|
||||||
|
SchemaChange: No schema change
|
@ -92,13 +92,14 @@ class DocumentCategoryController extends AbstractController
|
|||||||
|
|
||||||
$nextId = $em
|
$nextId = $em
|
||||||
->createQuery(
|
->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(
|
$documentCategory = new DocumentCategory(
|
||||||
ChillDocStoreBundle::class,
|
ChillDocStoreBundle::class,
|
||||||
reset($nextId)
|
$nextId
|
||||||
);
|
);
|
||||||
|
|
||||||
$documentCategory
|
$documentCategory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user