-
Notifications
You must be signed in to change notification settings - Fork 46
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
error when requesting additional fields #101
Comments
Hi @tacman, would you be interested in submitting another PR to fix this? |
Can you point me in the right direction? For the project I was working on, I simply filtered them after retrieving. |
It seems like the error is caused by the code expecting the 'source' key to exist. In your example you're filtering fields and 'source' isn't one of those included. Perhaps a change like this might be sufficient to fix the issue: - if ($version['source']) {
+ if (!empty($version['source'])) { |
That's what I did in #102, but it wasn't enough. |
So the key issue here is that depending on the parameters to list.json, it returns either a list of strings (package names), or if "fields" is present, a list of objects keyed by package names. So we need some sort of test to see what the result is. It's kinda ugly. I guess we can get the result back and check for is_array or array_is_list. Even better would be a real API, like API Platform. composer/packagist#1491 |
Generates an error because source isn't set in $version:
I'll submit a PR
The text was updated successfully, but these errors were encountered: