plusgallery
plusgallery copied to clipboard
google.html example not working with 2014-08-06 version
The current HEAD c5301290e6bf4dbd451da58bddcf29596f94e357 in master branch fails to work with the Google+ show-all-albums example google.html
. Instead of showing all available public albums on load, it shows a blank page instead.
It turns out that it was trying to access a non-existent resource with this URI:
- https://picasaweb.google.com/data/feed/base/user/jeremiahjmartin/albumid/undefined?alt=json&hl=en_US&callback=jQuery1720876449552597478_1410015224838&_=1410015225771
to which Google replies with a 404 Not Found error, saying "Invalid entity id: undefined".
For comparison, the working example at http://plusgallery.net/plusgallery/google.html, which uses an older-but-working +Gallery v0.8.5, loads the album index with this URI:
- https://picasaweb.google.com/data/feed/base/user/jeremiahjmartin?alt=json&kind=album&hl=en_US&max-results=16&callback=jQuery17207749732243828475_1410015568563&_=1410015568903
Thanks in advance for looking into this.
Anthony
Did a little troubleshooting because I really needed to make this work for a project (on v0.9.4). The issue seems to be around l:92 in plusgallery.js
, where it is determined whether an albumId
is specified. For some reason, in my example, where I have no albumId, just a user id and the type attribute for "google" the comparison ends up coming back true anyway.
if(pg.albumId !== null
|| pg.type == 'instagram'
|| (pg.type == 'local' && !pg.imageData.hasOwnProperty('albums')))
Anyway, I commented some of this out because I don't want to spend too much time on it, and things work now.
I've got the same problem using the Drupal Plus Gallery module, which uses the plusgallery javascript library. If you don't specify an album id, which you want if you want an overview of all the available albums, the library puts albumid/undefined in the url it fetches, which google+ doesn't understand.
Ok, I fixed it by changing line 92 of plusgallery.js from if(pg.albumId !== null to if(pg.albumId !== null && pg.albumId != undefined
I ran into exactly the same issue and determined another solution was just to default albumId to null:
If you look in plusgallery.js, under the /user defined Defaults/ section, change the lines from (showing line # and code):
60 imageData: null, 61 62 63 /don't touch/
To this:
60 imageData: null, 61 albumId: null, 62 63 64 /don't touch/