Skip to content
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 Notices up the Wazoo #57

Open
FlashBuddy opened this issue Apr 6, 2020 · 5 comments
Open

Error Notices up the Wazoo #57

FlashBuddy opened this issue Apr 6, 2020 · 5 comments

Comments

@FlashBuddy
Copy link

Using 1.5.5 (though it reports 1.5.3
Finds my albums via List Albums, but on the results:
Selection
No photo in the current set.
It is this screen that has these error notices:


Notice: Undefined index: photoset in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 189

Deprecated: Function create_function() is deprecated in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 199

Warning: Invalid argument supplied for foreach() in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 203

Warning: array_slice() expects parameter 1 to be array, null given in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 221

Deprecated: Function create_function() is deprecated in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 222

Warning: array_map(): Argument #2 should be an array in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 222

Warning: Invalid argument supplied for foreach() in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 224

Warning: count(): Parameter must be an array or an object that implements Countable in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 233

Warning: count(): Parameter must be an array or an object that implements Countable in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 234

Warning: count(): Parameter must be an array or an object that implements Countable in /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php on line 252

Warning: Cannot modify header information - headers already sent by (output started at /home/flashale/public_html/piwigo/plugins/flickr2piwigo/admin/import.php:189) in /home/flashale/public_html/piwigo/include/page_header.php on line 86

@jimcintosh
Copy link

jimcintosh commented May 5, 2020

I get these errors after clicking on a Flickr album:

Notice: Undefined index: photoset in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 189

Notice: Trying to access array offset on value of type null in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 189

Warning: Invalid argument supplied for foreach() in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 203

Warning: array_slice() expects parameter 1 to be array, null given in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 221

Warning: array_map(): Expected parameter 2 to be an array, null given in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 222

Warning: Invalid argument supplied for foreach() in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 224

Warning: count(): Parameter must be an array or an object that implements Countable in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 233

Warning: count(): Parameter must be an array or an object that implements Countable in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 234

Warning: count(): Parameter must be an array or an object that implements Countable in /home/jmcme/piwigo/plugins/flickr2piwigo/admin/import.php on line 252

Could it be because I couldn't find the Callback URL mentioned in https://piwigo.com/blog/2013/05/21/import-from-flickr-to-piwigo2/ ?

@kermie
Copy link

kermie commented Nov 5, 2020

This is apparently as the module doesn't seem to support PHP > 7. Obviously, you guys use PHP 7.2 or above. There are less errors and warnings in PHP 7.1 (supported until Dez 2019). However, it still doesn't work.

@PiAir
Copy link

PiAir commented Aug 16, 2021

I got it to work by making 3 changes in piwigo/plugins/flickr2piwigo/admin/import.php:

line 189:
change
$all_photos = $all_photos['photoset']['photo'];
to
$all_photos = $all_photos['photo'];

line 199:
change
$existing_photos = array_map(create_function('$p', 'return preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p);'), $existing_photos);
to
$existing_photos = array_map(function($p) {return preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p);}, $existing_photos);

line 222:
change
$all_elements = array_map(create_function('$p', 'return \'"\'.$p["id"].\'"\';'), $all_photos);
to
$all_elements = array_map(function($p) {return $p["id"];}, $all_photos);

@fncll
Copy link

fncll commented Jan 10, 2023

Thanks for the above fixes. Now things are working except for this intermittent error. Any ideas?

ERROR
An error happened:
Fatal error: Uncaught Samwilson\PhpFlickr\FlickrException: Unable to decode Flickr response to flickr.photos.getInfo request: 
<!DOCTYPE html> <html xmlns:cc="http://creativecommons.org/ns#" lang="en-us" class="no-js fluid html-error-500-page-view maximized-layout"> <head> <meta property="fb:app_id" content="137206539707334" /> <meta property="og:site_name" content="Flickr" /> <meta property="og:updated_time" content="2023-01-10T18:31:42.707Z" /> <script type="application/ld+json"> [{ "@context": "http://schema.org", "@type": "WebSite", "name": "Flickr", "url": "https://www.flickr.com", "potentialAction": { "@type": "SearchAction", "target": "https://www.flickr.com/search?text={search_term_string}&structured=yes", "query-input": "required name=search_term_string" } }, { "@context": "http://schema.org", "@type": "Organization", "url": "http://www.flickr.com", "logo": "https://www.flickr.com/images/opensearch-flickr-logo.png" }, { "@context": "http://schema.org", in /home/fncllorg/public_html/photos/plugins/flickr2piwigo/vendor/samwilson/phpflickr/src/PhpFlickr.php on line 354

@fncll
Copy link

fncll commented Jan 10, 2023

I guess I spoke too soon because now I am receiving another error involving photo data and arrays:

Warning: in_array() expects parameter 2 to be array, null given in /home/fncllorg/public_html/photos/plugins/flickr2piwigo/vendor/samwilson/phpflickr/src/PhotosApi.php on line 129

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

No branches or pull requests

5 participants