Skip to content

Labels in card are not saved #31

@azorgh

Description

@azorgh

Hi guys,

When i'm trying to create a new card, there is no problem with this. But, if I want to assign a label on this card with the addLabel method, it seems doesn't work.

For example :

$card = new Card();
$card->setName('Name');
$card->setDescription('Description');

$card->addLabel('green');//-> $this->data['labels'] doesn't exists, a error was thrown
// OR
$card->setLabels([['colors' => 'green']]); //->Array has been taken from addLabel function

$card->save();

If we debug the body of the request send on save, we have this (with the addLabel and the fix for $data['labels'] not exists) :

array (
  'idBoard' => 'xxxxxxxxxxxx',
  'idList' => 'xxxxxxxxx',
  'name' => 'Name',
  'desc' => 'Description',
  'due' => NULL,
  'urlSource' => NULL,
  'labels/0' => 'green',
)  

I think the body is not good according to Trello API right ?

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions