Closed piotrp321 closed 4 years ago
I cannot reproduce this issue. Could you provide us with more details? You can also contact SMSAPI support so we would be able to track your issue.
Ok, i am trying do debug this problem. I have a fix
vendor/smsapi/php-client/src/Feature/Contacts/Data/ContactFactory.php
private function createCustomFieldsFromObject(stdClass $object): array
{
$objectCustomFieldsProperties = array_filter(
get_object_vars($object),
[$this, 'isCustomFieldProperty'],
ARRAY_FILTER_USE_KEY
);
$customFields = [];
foreach ($objectCustomFieldsProperties as $name => $value) {
$customFields[] = $this->contactCustomFieldFactory->create($name, (string)$value);
}
return $customFields;
}
I added transform value to string because in my case $objectCustomFieldsProperties look like that:
Thanks for your input. The problem is somewhere else. The 'undelivered messages' contact field is dynamic and was mistakenly omitted on built in contact fields list.
Fix is already in master branch. It is now under code review and test. It will be included in next minor release.
Hello
I have a searching phone number like this:
And sometimes this code return error
Argument 2 passed to Smsapi\Client\Feature\Contacts\Data\ContactCustomFieldFactory::create() must be of the type string, int given, called in ...../vendor/smsapi/php-client/src/Feature/Contacts/Data/ContactFactory.php on line 66