Skip to content

PhotosApi: $photoset should be an array #88

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arfevrier
Copy link

Hello,
Here a fix when using the librairy to import photo through Flickr2Piwigo. I got the following error when importing photos from my account:

<br />
<b>Fatal error</b>:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /config/www/plugins/flickr2piwigo/vendor/samwilson/phpflickr/src/PhotosApi.php:477
Stack trace:
#0 /config/www/plugins/flickr2piwigo/vendor/samwilson/phpflickr/src/PhotosApi.php(477): in_array()
#1 /config/www/plugins/flickr2piwigo/include/ws_functions.inc.php(147): Samwilson\PhpFlickr\PhotosApi-&gt;getSets()
#2 /app/www/public/include/ws_core.inc.php(600): ws_flickr2piwigo_importPhoto()
#3 /app/www/public/include/ws_protocols/rest_handler.php(41): PwgServer-&gt;invoke()
#4 /app/www/public/include/ws_core.inc.php(281): PwgRestRequestHandler-&gt;handleRequest()
#5 /app/www/public/ws.php(22): PwgServer-&gt;run()
#6 {main}
  thrown in <b>/config/www/plugins/flickr2piwigo/vendor/samwilson/phpflickr/src/PhotosApi.php</b> on line <b>477</b><br />

Fix: Uncaught TypeError: in_array(): Argument samwilson#2 ($haystack) must be of type array, null given in /config/www/plugins/flickr2piwigo/vendor/samwilson/phpflickr/src/PhotosApi.php:477
@samwilson
Copy link
Owner

This looks good, thanks! I think getSets() is supposed to be replaced at some point, but this is probably sensible in the meantime. c.f. #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants