-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
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
Count method expects an array or object #10
Comments
Hi there, Could you clarify which sample this relates to and the specific line generating the error? If you can provide a sanitized log of the request and response leading up to this is would be helpful. Regards, |
Hi Jonathon,
I use action which is the **DownloadItems**. This error occurs on the 59th
line examples/DownloadItems.php.
**if (!isset($result['lineItems']) || count($result['lineItems']) < 1) {**
Here, the count method expects an array or an object but the string is
coming.
…On Fri, Jun 21, 2019 at 6:44 AM Jonathon Imperiosi ***@***.***> wrote:
Hi there,
Could you clarify which sample this relates to and the specific line
generating the error? If you can provide a sanitized log of the request and
response leading up to this is would be helpful.
Regards,
- Jonathon Imperiosi, DBM API Team
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10?email_source=notifications&email_token=ADYUUQH3PHNIOBTNDZZ6HKDP3RFBDA5CNFSM4HZSGBE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYHKXKQ#issuecomment-504277930>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADYUUQHAHET74IQW6DZD3VTP3RFBDANCNFSM4HZSGBEQ>
.
|
Thanks for the additional info. Can you try modifying that line to: if (empty($result['lineItems'])) { And let me know if you're still getting an error? |
In fact, I've changed the following:
if (!isset($result['lineItems']) || mb_strlen($result['lineItems']) < 1) {
It's beautiful with this. In addition to this, I tried as you mentioned.
Likewise, it's working correctly.
…On Fri, Jun 21, 2019 at 10:27 AM Jonathon Imperiosi < ***@***.***> wrote:
Thanks for the additional info. Can you try modifying that line to:
if (empty($result['lineItems'])) {
And let me know if you're still getting an error?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10?email_source=notifications&email_token=ADYUUQAZ4SKUA5MJPOLF463P3R7GNA5CNFSM4HZSGBE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYHVWII#issuecomment-504322849>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADYUUQC7D6FUU5LSNG6BFY3P3R7GNANCNFSM4HZSGBEQ>
.
|
Thanks for confirming, I'll update the samples to remove count(). Since the value is always a string that check isn't even necessary. All we need to verify is that the field exists and is non-empty. |
I totally understood. Thanks a lot!
…On Fri, Jun 21, 2019 at 10:34 AM Jonathon Imperiosi < ***@***.***> wrote:
Thanks for confirming, I'll update the samples to remove count(). Since
the value is always a string that check isn't even necessary. All we need
to verify is that the field exists and is non-empty.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10?email_source=notifications&email_token=ADYUUQFATVMLRR72MBWBMRTP3R76XA5CNFSM4HZSGBE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYHWDDQ#issuecomment-504324494>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADYUUQAKZCODTHAVKNUP36LP3R76XANCNFSM4HZSGBEQ>
.
|
Once I download line items, I've been getting this unexpected error. count(): Parameter must be an array or an object that implements Countable
The text was updated successfully, but these errors were encountered: