Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

Catchable fatal error: Argument 1 must be of the type array, string given #145

@epilektric

Description

@epilektric

Here is the full PHP error:

Catchable fatal error: Argument 1 passed to Ctct\Components\Activities\ActivityError::create() must be of the type array, string given, called in Ctct\Components\Activities\Activity.php on line 47 and defined in Ctct\Components\Activities\ActivityError.php on line 24

The API responds with something like the following:

array(10) { 
	["id"]=> string(36) "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 
	["type"]=> string(12) "ADD_CONTACTS" 
	["status"]=> string(8) "COMPLETE" 
	["errors"]=> array(2) { 
		[0]=> string(23) "Line 355: Invalid email" 
		[1]=> string(24) "Line 1068: Invalid email" 
	} 
	["file_name"]=> string(30) "default_list.txt" 
	["start_date"]=> string(24) "2017-04-11T13:55:30.000Z" 
	["finish_date"]=> string(24) "2017-04-11T13:55:41.000Z" 
	["created_date"]=> string(24) "2017-04-11T13:55:25.000Z" 
	["error_count"]=> int(50) 
	["contact_count"]=> int(1445) 
} 

But ActivityError::create() is expecting something like this:

array(10) { 
	["id"]=> string(36) "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 
	["type"]=> string(12) "ADD_CONTACTS" 
	["status"]=> string(8) "COMPLETE" 
	["errors"]=> array(2) { 
		[0]=> array(2) {
			["line_number"]=> int(355)
			["message"]=> string(13) "Invalid Email"
		}
		[1]=> array(2) {
			["line_number"]=> int(1068)
			["message"]=> string(13) "Invalid Email"
		}
	} 
	["file_name"]=> string(30) "default_list.txt" 
	["start_date"]=> string(24) "2017-04-11T13:55:30.000Z" 
	["finish_date"]=> string(24) "2017-04-11T13:55:41.000Z" 
	["created_date"]=> string(24) "2017-04-11T13:55:25.000Z" 
	["error_count"]=> int(50) 
	["contact_count"]=> int(1445) 
} 

Metadata

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