How to Fix a Broken Embedded Flickr Album

I recently had need to embed a Flickr album, as I’ve done many times before. When I published the article, however, the album was broken and only showed a single image. Odd, sure, but I figured I had just copied the wrong embed code; an hour later and I was fairly certain I hadn’t.

The Problem

What I wanted was a gallery that showed all the photos in the Flickr album in order, with left and right arrow-buttons for navigation. Something like this:

Kew Gardens & Science Museum

Looks great, simple to use and what I’ve always had when using the Flickr embed codes in the past. The problem, though, was that instead of a nice gallery I just had this:

Kew Gardens & Science Museum

Looks similar, but it’s just a static image linked to the album page on my Flickr profile; there’s no way to scroll or navigate through the photos. Weird right! A few hours Googling around the subject later and the bad news is that the issue is frequently encountered, but not consistent, so doesn’t appear to be considered as a bug. The good news, though, is that you can manually force an embed code to behave in the ‘correct’ way, you just need to know how.

How to Fix It

Full thanks should be directed at Flickr user studyabroadwmu who posted the missing piece to the puzzle in a Flickr support thread last year.

The trick is noticing the seemingly innocuous difference in the anchor tag of the embed code generated for the two albums above:

<a title="Kew Gardens & Science Museum" href="https://www.flickr.com/photos/161720506@N06/albums/72157669217526758" data-flickr-embed="true" data-footer="true">

As opposed to:

<a title="Kew Gardens & Science Museum" href="https://www.flickr.com/gp/161720506@N06/y5R7Wu" data-flickr-embed="true" data-footer="true">

Why the bottom embed code was generated using some kind of URL shortening is not clear, but that’s the root of the issue. Want to fix it, just open the album in Flickr and take a look at the URL in the browser bar, which in this case would be:

https://www.flickr.com/photos/161720506@N06/sets/72157669217526758/

Now copy that and paste it over the value of the href attribute and, hey presto, you should have a working embedded gallery once again!

Palliative Bug Fixes

A palliative is a treatment that soothes even if it can’t cure the illness.

By all means, whenever you can, fix the problem, go to the root cause, come up with a better design…

But when you can’t (and that’s most of the time, because the straightforward problems have already been solved), the effort you put into providing a palliative will not go unnoticed or unappreciated.

~ Seth Godin

I’ve been catching up on Seth’s blog (I’m woefully behind on pretty much everything at the moment) and this post in particular caught my attention, largely because it reminded me of the reason why I haven’t really been reading/posting/watching anything much lately: Pokémon Go. I’d still like to do a full breakdown of that game, which isn’t this, but Seth’s words really summed up one of the aspects of the game’s development that has impressed me.

Anyone who has had anything to do with Go by now has probably come up against one of their many bugs. When the game first launched there were dozens; the game would freeze when you caught a Pokémon, when you didn’t, when you span the map too quickly, when you randomly encountered the wrong species or item. It crashed routinely, the servers were completely unstable and core features, such as the Pokédex and tracker, straight up didn’t work. The game was a mess and often very frustrating, but many people saw the gem at the core and decided to stick around anyway (yours truly, clearly, included).

Over a month later and many of these issues persist. However, quite a lot of the bugs have been addressed. Sometimes, as with the now infamous “three footsteps” glitch or the more recent issue where some Pokémon randomly changed upon a successful catch, it seemed like each fix broke something else. Despite this the game is now far more robust than at launch and barely ever force quits for me any more. I can tell several of the bugs still exist, but wonderfully were they couldn’t instantly cure the problem they’ve introduced palliative solutions.

Sometimes, the game hangs when loading. When it first launched, you couldn’t do anything when this occurred except either wait it out and hope or force the app to crash and reload. Now, after a certain time has elapsed, a “Sign Out” button automatically appears. Press it and you’re returned to the initial splash screen where you can reattempt to connect. It’s not a fix – the loading screen can still hang – but it presents a much less frustrating solution than the previous alternative. Same goes for one of the earliest bugs where the “rocking Pokéball” animation would just fail to load, locking you into a useless screen and forcing you to (again) force quit the app. This bug still occurs for me from time to time, but now the app deals with it, forcing the next animation to trigger and ignoring that the previous one never did. These are simple, easy “fixes” that don’t solve the (I imagine) rather complex underlying root causes of these issues, but make the game infinitely more enjoyable to play regularly.

I’ve never seen a games developer or software company really take this approach before, but Niantec seem to be making it work for them and personally, I think I’ve learnt something about how to handle problematic code.