We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK you're using (please complete the following information):
Describe the bug When testing upgrading to SDK version 6, I am getting unhandled InvalidArgumentException fatal errors when running getContacts().
InvalidArgumentException
getContacts()
The issue only occurs if the contact being looked up does not existing in Xero. If the contact does exist in Xero, no exception is thrown.
Full stack trace below:
Uncaught InvalidArgumentException: invalid length for $contacts when calling GetContactsResponse., number of items must be greater than or equal to 1. in /..../app/vendor/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetContactsResponse.php:399 Stack trace: #0 /..../app/vendor/xeroapi/xero-php-oauth2/lib/AccountingObjectSerializer.php(358): XeroAPI\XeroPHP\Models\Accounting\GetContactsResponse->setContacts(Array) #1 /..../app/vendor/xeroapi/xero-php-oauth2/lib/Api/AccountingApi.php(28868): XeroAPI\XeroPHP\AccountingObjectSerializer::deserialize(Object(stdClass), '\\XeroAPI\\XeroPH...', Array) #2 /..../app/vendor/xeroapi/xero-php-oauth2/lib/Api/AccountingApi.php(28811): XeroAPI\XeroPHP\Api\AccountingApi->getContactsWithHttpInfo('38b66c...........', NULL, 'ContactNumber="...', NULL, NULL, 1, true, false, NULL, NULL) #3 /..../app/wwwroot/includes/pageSections/addressbook/addEdit_form.php(319): XeroAPI\XeroPHP\Api\AccountingApi->getContacts('38b66c..........', NULL, 'ContactNumber="...', NULL, NULL, 1, true) #4 /..../app/wwwroot/addressbook.php(256): require('/..........') #5 {main} thrown
To Reproduce Run the following code to look up a contact in Xero, where the query would ordinarily return zero results:
try { $xeroApiInstance = new XeroAPI\XeroPHP\Api\AccountingApi( new GuzzleHttp\Client(), $xeroApiAuthorisation->getConfig() ); $resultXeroContact = $xeroApiInstance->getContacts($xeroApiAuthorisation->getTenantId(), null, 'ContactNumber="'.$addressbook_id.'"', null, null, 1, true); if (!is_null($resultXeroContact) && count($resultXeroContact->getContacts()) == 1) { ///Logic to handle the contact details } } catch (\XeroAPI\XeroPHP\ApiException $e) { if ($e->getCode() != 404) { //handle the exception } }
Expected behavior A 404 http code should be thrown by XeroAPI\XeroPHP\ApiException in the catch block.
XeroAPI\XeroPHP\ApiException
The text was updated successfully, but these errors were encountered:
PETOSS-458
Sorry, something went wrong.
Thanks for raising an issue, a ticket has been created to track your request
No branches or pull requests
SDK you're using (please complete the following information):
Describe the bug
When testing upgrading to SDK version 6, I am getting unhandled
InvalidArgumentException
fatal errors when runninggetContacts()
.The issue only occurs if the contact being looked up does not existing in Xero. If the contact does exist in Xero, no exception is thrown.
Full stack trace below:
To Reproduce
Run the following code to look up a contact in Xero, where the query would ordinarily return zero results:
Expected behavior
A 404 http code should be thrown by
XeroAPI\XeroPHP\ApiException
in the catch block.The text was updated successfully, but these errors were encountered: