labelId must be provided and must be numeric
Hi,
When creating a new card from the dashboard I get the following error:
labelId must be provided and must be numeric.
Has anyone else encountered this?
Thanks for your report. I was able to reproduce somewhat. Could you please share the exact order of things you inserted the data into the form? When trying to reproduce I noticed that when you insert the title and set a tag after, everything works. But when you set the tag and then insert the title I get "cardId must be provided and must be numeric" I was not able to reproduce to get "labelId must be provided and must be numeric". I think they are of similar origin but it would be helpful if you could help me reproduce the exact issue, by describing your steps.
Hi, I'm facng de same issue (Nextcloud 31 Nextcloud hub 10) AIO deployement on docker
Steps to reproduce :
From Deck, next card, click to add a new card
- Filling juste the name of the card => OK
- Filling name + descirption => OK
- Filling name + user => KO error message
- Filling name + user + due date => KO error message
- Filling name + user + due date + description => KO error message
We can reproduce this if we add the card from "Upcoming cards" + and assign a user to this card. Nextcloud 31.0.0 with Deck 1.15.0
Firstly, thanks for the awesome work :) Having the same issue with Nextcloud 31.0.4 and Deck 1.15.1
yes duplicate of #6818
I think this issue can be marked as related to #6818 since they have same error message and stem from same function. But they are related to different request endpoints.
To resolve this issue, you need to patch the file "nextcloud/apps/deck/lib/Controller/CardController.php", as follows:
--- nextcloud/apps/deck/lib/Controller/CardController.php 2025-04-29 10:36:30.000000000 +0200
+++ nextcloud/apps/deck/lib/Controller/CardController.php 2025-06-12 16:12:37.000000000 +0200
@@ -62,17 +62,17 @@
* @return \OCP\AppFramework\Db\Entity
*/
public function create($title, $stackId, $type = 'plain', $order = 999, string $description = '', $duedate = null, $labels = [], $users = []) {
$card = $this->cardService->create($title, $stackId, $type, $order, $this->userId, $description, $duedate);
foreach ($labels as $label) {
- $this->assignLabel($card->id, $label);
+ $this->assignLabel($card->getId(), $label);
}
foreach ($users as $user) {
- $this->assignmentService->assignUser($card->id, $user['id'], $user['type']);
+ $this->assignmentService->assignUser($card->getId(), $user['id'], $user['type']);
}
return $card;
}
/**
Because in the CardController class, "$card->id" returns NULL.
@gaudryc could you do a pr ? I do not like doing that, but @luka-nextcloud or @juliusknorr can the fix proposed be implemented ?
To resolve this issue, you need to patch the file "nextcloud/apps/deck/lib/Controller/CardController.php", as follows:
--- nextcloud/apps/deck/lib/Controller/CardController.php 2025-04-29 10:36:30.000000000 +0200 +++ nextcloud/apps/deck/lib/Controller/CardController.php 2025-06-12 16:12:37.000000000 +0200 @@ -62,17 +62,17 @@ * @return \OCP\AppFramework\Db\Entity */ public function create($title, $stackId, $type = 'plain', $order = 999, string $description = '', $duedate = null, $labels = [], $users = []) { $card = $this->cardService->create($title, $stackId, $type, $order, $this->userId, $description, $duedate); foreach ($labels as $label) { - $this->assignLabel($card->id, $label); + $this->assignLabel($card->getId(), $label); } foreach ($users as $user) { - $this->assignmentService->assignUser($card->id, $user['id'], $user['type']); + $this->assignmentService->assignUser($card->getId(), $user['id'], $user['type']); } return $card; } /**Because in the CardController class, "$card->id" returns NULL.
Worked like a charm.
@gaudryc could you do a pr ? I do not like doing that, but @luka-nextcloud or @juliusknorr can the fix proposed be implemented ?
For reasons I can't go into here, I can't. You already have everything you need so it only takes five minutes. Regards
To resolve this issue, you need to patch the file "nextcloud/apps/deck/lib/Controller/CardController.php", as follows:
--- nextcloud/apps/deck/lib/Controller/CardController.php 2025-04-29 10:36:30.000000000 +0200 +++ nextcloud/apps/deck/lib/Controller/CardController.php 2025-06-12 16:12:37.000000000 +0200 @@ -62,17 +62,17 @@ * @return \OCP\AppFramework\Db\Entity */ public function create($title, $stackId, $type = 'plain', $order = 999, string $description = '', $duedate = null, $labels = [], $users = []) { $card = $this->cardService->create($title, $stackId, $type, $order, $this->userId, $description, $duedate); foreach ($labels as $label) { - $this->assignLabel($card->id, $label); + $this->assignLabel($card->getId(), $label); } foreach ($users as $user) { - $this->assignmentService->assignUser($card->id, $user['id'], $user['type']); + $this->assignmentService->assignUser($card->getId(), $user['id'], $user['type']); } return $card; } /**Because in the CardController class, "$card->id" returns NULL.
Thank you! I created a PR at https://github.com/nextcloud/deck/pull/7139