adobe / adobe/stock-api-libphp

Can't get categories of top level (parentId === 0)

Open
#15 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
20
Forks
23
PR merge metrics
No merged PRs in 30d

Description

# Issue report
To get tree (child categories) need to use method \AdobeStock\Api\Client\SearchCategory::getCategoryTree
This method has next lines:
`
if ($request->getCategoryId() == null) {
throw StockApiException::withMessage('Category Id cannot be null');
}
`

But categories of top level have parentId == 0. And exception thrown in this case

It could be fixed if use strict compare with null
`
if ($request->getCategoryId() === null) {
throw StockApiException::withMessage('Category Id cannot be null');
}
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.