Skip to content

No color tag displayed for statuses on Items list scrren #58

Open
@zhildzik

Description

On the Template Mappings screen when review items for import, no Color icon displayed for statuses:
(GatherContent - Template Mappings - and under existing template mapping click "Review Items for Import)

image

image

It happens because get_project_items method in API class (includes/classes.api.php) return items list without status field.

As quick fix I just added loop with add_status_to_item method applied to all items returned by API:

public function get_project_items( $project_id, $template_id ) {
	$query_params = array(
		'template_id' => $template_id,
		'include'     => 'status_name',
		'per_page'    => 500,
	);

	$response = $this->get(
		'projects/' . $project_id . '/items',
		array(
			'headers' => array(
				'Accept' => 'application/vnd.gathercontent.v2+json',
			),
		),
		'',
		$query_params
	);

	foreach ($response as $i => $item) {
		$response[ $i ]->status = (object) $this->add_status_to_item( $item );
	}

	return $response;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions