deck icon indicating copy to clipboard operation
deck copied to clipboard

labelId must be provided and must be numeric

Open jgarte opened this issue 11 months ago • 7 comments

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?

Image

jgarte avatar Feb 10 '25 20:02 jgarte

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.

grnd-alt avatar Feb 11 '25 07:02 grnd-alt

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

Image

  • Filling name + user + due date => KO error message

Image

  • Filling name + user + due date + description => KO error message

rsi-art avatar Feb 28 '25 12:02 rsi-art

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

slu-010101 avatar Mar 04 '25 15:03 slu-010101

Firstly, thanks for the awesome work :) Having the same issue with Nextcloud 31.0.4 and Deck 1.15.1

MarcSchuh avatar May 03 '25 17:05 MarcSchuh

yes duplicate of #6818

Aveyron-RetD avatar May 21 '25 07:05 Aveyron-RetD

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.

luka-nextcloud avatar May 22 '25 08:05 luka-nextcloud

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 avatar Jun 12 '25 14:06 gaudryc

@gaudryc could you do a pr ? I do not like doing that, but @luka-nextcloud or @juliusknorr can the fix proposed be implemented ?

Aveyron-RetD avatar Jul 01 '25 09:07 Aveyron-RetD

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.

wabassis avatar Jul 06 '25 00:07 wabassis

@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

gaudryc avatar Jul 07 '25 15:07 gaudryc

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

enjeck avatar Jul 28 '25 08:07 enjeck