getAlbums not working as expected

Hello,

when trying to get the names of all existing albums I tried this:
`$_zp_gallery->getAlbums(0,null,null,true,true)`
expecting to get both published and unpublished albums. I only get published albums though. Tried setting the last param ($mine) to false as well, without success.

Is that correct behaviour? How would I get a list that includes unpublished albums?

Quick note: tried some stuff in class-gallery and it seems that it's the `sortAlbumArray` function that doesn't return the unpublished albums, no matter how you set $mine.

Thanks for your help.

Comments

  • acrylian Administrator, Developer
    Works for me as intended with lastest 1.4.5.8 support build. Note it of course only returns the top level albums for sub albums you have to use further object model methods of the album class.
  • Strange, as that's the version I'm working with and I'm talking about top level albums. I thought it might be a plugin interfering, but that didn't change anything.

    So just to be sure, `$_zp_gallery->getAlbums(0,null,null,true,true)` should return a list of ALL albums, whether published or not, no matter if I'm logged in or not?

    Sorry for bugging you about this.
  • acrylian Administrator, Developer
    Yes, that it is supposed to do and did for me when I tested.
  • Okay, I found out that after I call the template functions `getNextAlbum` or `getPrevAlbum` the gallery class function `getAlbums` will only return published albums, no matter how you set the $mine parameter.
    Is that intended behaviour or should I file a bug report? It's a small thing, but can be quite annoying because it's so unexpected.
  • acrylian Administrator, Developer
    Best you indeed open a ticket with the exact description of what you do how. Be sure to use the lastest 1.4.5.9 just released.
  • Seems I was mistaken in my experimenting. I just tried again and the problem actually seems to be that when you call getAlbums on $_zp_gallery once either without parameters or with $mine set to false, subsequent calls (with $mine set to true) return only the filtered (published) entries.
    I opened a ticket describing that. Thanks!
Sign In or Register to comment.