Asana / php-asana

Official PHP client library for the Asana API v1
MIT License
136 stars 59 forks source link

Error on createTask #78

Closed Neolot closed 3 years ago

Neolot commented 3 years ago

Hi! I am trying to create a task and I am getting an error:

array_search() expects parameter 2 to be array, null given
/vendor/asana/asana/src/Asana/Client.php(333)  

Here is my code:

$args = array(
    'name'      => $this->task_data['title'],
    'notes'     => $this->task_data['description'],
    'assignee'  => $this->task_data['gid'],
    'followers' => array( $this->task_data['gid'] ),
    'due_on'    => $this->task_data['dueon'],
    'workspace' => $this->task_data['workspace']
);

if ( !empty( $this->task_data['project'] ) ) {
    $args['projects'] = array( $this->task_data['project'] );
}

$task = $this->asana->tasks->createTask( $args );

What am I doing wrong?