I started getting the following errors multiple times on every page whether it was using Flickr photos or not:
Notice: Undefined offset: 0 in theme_flickr_photo() (line 686 of /home/anaheime/public_html/sites/all/modules/flickr/flickr.module).
Notice: Trying to get property of non-object in theme_flickr_photo() (line 686 of /home/anaheime/public_html/sites/all/modules/flickr/flickr.module).
Notice: Undefined offset: 0 in theme_flickr_photo() (line 689 of /home/anaheime/public_html/sites/all/modules/flickr/flickr.module).
Notice: Trying to get property of non-object in theme_flickr_photo() (line 689 of /home/anaheime/public_html/sites/all/modules/flickr/flickr.module).
Warning: end() expects parameter 1 to be array, null given in theme_flickr_photo() (line 690 of
Comment | File | Size | Author |
---|---|---|---|
#8 | flickr-undefined_offset-2711969-8.patch | 1.48 KB | lolandese |
#3 | Flicr_Adv2.png | 221.07 KB | wzain |
#3 | Flicr_Global_opt2_adv1.png | 289.73 KB | wzain |
#3 | Flicr_Global_opt.png | 211.27 KB | wzain |
Comments
Comment #2
lolandese CreditAttribution: lolandese commentedI need to know some of your settings. Please send me a screenshot of admin/config/media/flickr with both the GLOBAL and ADVANCED section in uncollapsed state.
Thanks.
Comment #3
wzain CreditAttribution: wzain commentedHi
Here are the settings you requested. Thanks for looking into it.
Please see attachments.
Comment #4
lolandese CreditAttribution: lolandese commentedTo hide these messages from your visitors, at admin/config/development/logging start by setting Error messages to display to None. This is the usual setting for Production. I agree that it should be solved but debugging usually takes place in Development (where you do show these messages).
Comment #5
wzain CreditAttribution: wzain commentedI changed the settings as recommended.
I am not sure I understand your answer. Are you saying this is a known bug that you are working on?
Comment #6
lolandese CreditAttribution: lolandese commentedIt's just a quick "fix" for the "symptoms". The cause needs still to be looked into.
It depends on a certain combination of using Google instead of Flickr for location info (reverse geocoding) and the connection method (cURL, fopen).
Your report made me aware of the issue. Thanks for that. I will try to replicate it first at https://simplytest.me/project/flickr/7.x-1.x.
Comment #7
wzain CreditAttribution: wzain commentedHi. Any updates on this issue? I am still getting a lot of those errors in the log and they are slowing the site down.
Comment #8
lolandese CreditAttribution: lolandese as a volunteer commentedApologies for the late fix.
Comment #9
lolandese CreditAttribution: lolandese as a volunteer commentedMmm. It seems instead it has to do with #3134599: To use maps.googleapis.com/maps/api/geocode now an API key is required.
There is a better way by checking for the response status and use a conditional like:
That takes care of the errors. We then still need to set a Google API key to make an authorized API call, as for the above-mentioned feature request.
Comment #10
lolandese CreditAttribution: lolandese as a volunteer commentedAs there was another occurrence of the pain-causing Google API call, a different patch has been provided there that fixes the issue here in a better way. Go there and review: #3134578: Several PHP notices: undefined offset, trying to get property of non-object
Closing this one as a duplicate, despite this being the older issue (sorry).