I have a problem with my 'Flickr: Set photos optionally tagged as term from node'-block since a few days, the settings are:
Flickr photoset ID: 72157647138841941
Show n photos: 18
Size: square - s: 75px square
Order: Latest taken (newest first)
Media type: foto's
Filter by vocabulary:

In the past I could refresh the pictures in this block by clearing all caches, since last Wednesday this stopped to work. When I change the number of photo's to show to 75 (the number of photo's in the set at the moment) it shows all again. Changing the number back to 18 results in the old set being shown again.

Comments

lolandese’s picture

Version: 7.x-1.6 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.16 KB

Creating 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.

lolandese’s picture

More performant and without the limitation of 500.

lolandese’s picture

Added a debug part and a fallback in case $per_page is not set or 0, avoiding an empty album for this reason.

Eupeodes’s picture

Thanks 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

lolandese’s picture

Status: Needs review » Reviewed & tested by the community

I have tested your patch on my website and now I am indeed able to display the 18 most recent pictures..

I 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.

  • lolandese committed 2d6aaef on
    Issue #2375437 by Eupeodes: Newest pictures of set not shown
    
lolandese’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.