You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this fails because [] is not an object. it's an array.
sample error message:
[31-Jul-2024 13:43:16 UTC] PHP Fatal error: Uncaught Error: Attempt to assign property "Organisations" on array in /home/crm/www/vendor/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisations.php:311
Stack trace:
#0 [internal function]: XeroAPI\XeroPHP\Models\Accounting\Organisations->jsonSerialize()
#1 /home/crm/www/php/api.php(370): json_encode(Array, 2097152)
#2 {main}
thrown in /home/crm/www/vendor/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisations.php on line 311
To Reproduce
Steps to reproduce the behavior:
do something which causes jsonSerialize() to run.
Expected behavior
I expect it to just create the expected JSON and return it.
Additional context
if you change $json->Organisations to $json['Organisations'] that fixes the immediate problem, but you appear to have made the exact same mistake in other files as well (see Contacts.php in the same directory, line 344).
The text was updated successfully, but these errors were encountered:
SDK you're using (please complete the following information):
Describe the bug
in the method
jsonSerialize
,$json
is initialised as a plain array[]
4 lines later, you try to set
$json->Organisations
on it. https://github.com/XeroAPI/xero-php-oauth2/blob/master/lib/Models/Accounting/Organisations.php#L311this fails because
[]
is not an object. it's an array.sample error message:
To Reproduce
Steps to reproduce the behavior:
jsonSerialize()
to run.Expected behavior
I expect it to just create the expected JSON and return it.
Additional context
if you change
$json->Organisations
to$json['Organisations']
that fixes the immediate problem, but you appear to have made the exact same mistake in other files as well (see Contacts.php in the same directory, line 344).The text was updated successfully, but these errors were encountered: