Closed (fixed)
Project:
Flickr
Version:
7.x-1.x-dev
Component:
flickr_block
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2014 at 16:53 UTC
Updated:
3 Dec 2014 at 17:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lolandese commentedCreating the block from scratch with the same parameters in the sandbox also shows the wrong last taken photos. This excludes it is a caching issue.
Enabling the Devel module and uncommenting line 911 in flick.inc shows us on block save:
$type=photoset $delta=7 $id=72157647138841941 $sort=date-taken-desc $filter= $page=1 $per_page=72 $tags= $vocab_isset=0 $total=75 $lat= $lon= $radius=$per_page=72 shows that our querying of the Flickr API is too limited (we have 75 photos in the set). We made the API request quicker by limiting the number of photos to return. For recent sorted photos this is 4 x the displayed number to provide a sufficient distinction between recently uploaded and recently taken. Your problem would temporarily taken care of by setting the number of photos to display to 21 (4x21=84 > 75). When the number in the set reaches 85, you have the same problem again.
Our problem lies in the fact that flickr.photosets.getPhotos returns a list with the oldest photos first. The attached patch solves the issue for sets up to 500 photos. That seems acceptable to not compromise performance too much, but it remains a limitation.
TODO: Add a note in the documentation about it.
Thanks for reporting. Providing the used parameters to replicate the issue was fundamental.
Comment #2
lolandese commentedMore performant and without the limitation of 500.
Comment #3
lolandese commentedAdded a debug part and a fallback in case $per_page is not set or 0, avoiding an empty album for this reason.
Comment #4
Eupeodes commentedThanks for looking into this issue. I have tested your patch on my website and now I am indeed able to display the 18 most recent pictures of the set again as you can see on http://martentacoma.nl
Comment #5
lolandese commentedI guess it can be set to RTBC then.
That's a nice use case you linked to. I always like to see the module in action.
Thanks for testing.
Comment #7
lolandese commented