[dev] Ansel Gallery IDs vs. Names

Ben Klang ben at alkaloid.net
Wed Feb 20 07:22:44 UTC 2008


Hi All,

While updating my Ansel install I found that some functionality in  
the API I had been relying on has disappeared.  Since I'm not quite  
sure how to repair it, I am posting here.

In the old version of ansel/lib/api.php (prior to CVS HEAD version  
1.63) the createGallery() method accepted a gallery_id parameter.   
While certainly this is most commonly autogenerated, in my case I  
have an application that expects to be able to set the gallery ID  
programmatically.  From reading the code as it exists today, this is  
not possible.  The gallery ID is now forced to be a random string.

The second problem is that the previous galleryExists() method  
expected a gallery name as the parameter to search. This one was  
probably partially my fault: a confusion between gallery ID and  
gallery name.  Regardless the API documentation in lib/api.php talks  
about the argument to galleryExists() expecting a gallery name, while  
the underlying method expects a gallery ID.  Since gallery IDs are  
now random, the galleryExists() method has been rendered pretty  
useless to me.  While it is possible to look up an ID via the  
Gallery's name (internally within Ansel; not through the API), this  
is not nearly as reliable of a mechanism as the gallery name can change.

So I'm stuck.  I think it's clear that the galleryExists() API  
documentation needs to be amended to reference the gallery ID instead  
of a name.  But does it cause any problems to restore the old API  
functionality of allowing the gallery ID to be specified via the API  
rather than forcing a random ID?  Why was this option removed?

My apologies if this question belongs on the Ansel list.  It appears  
that most traffic on ansel at lists.horde.org is implementation and  
usage related.  As this is a development question I thought it might  
be better addressed here.

Thanks for any feedback,
/BAK/
-- 
Ben Klang
Alkaloid Networks LLC
ben at alkaloid.net
404.475.4850
http://projects.alkaloid.net




More information about the dev mailing list