[ansel] Another Bug

Michael Rubinsky mrubinsk at horde.org
Thu Jul 24 15:56:40 UTC 2008


Quoting David Cummings <lupinsansei_st at yahoo.com>:

> Thanx!!! Found another while calling getGalleries:
> Notice:  Undefined property:  Ansel_Gallery::$_data in  
> /srv/vhost/sites/www.metal.com/apps/ansel/lib/api.php on line 787
> The offending code is:
> $galleries[$gallery->id] = $gallery->_data;
> And sure enough Ansel_Gallery doesn't have that attribute; my guess  
> was that line was intended to just return the $gallery itself so I  
> patched it:
> $galleries[$gallery->id] = $gallery; //$gallery->_data;

Actually, that was already fixed in the same patch that I pointed you  
to in the last email. If you've updated from CVS, then you should have  
that fix.  Incidentally, it should be $gallery->data, not $gallery.   
(data is an inherited property from the hierarchical share object.


>
> I'm hoping this is what was intended as after I made the changes I  
> was able to keep coding with the  data I wanted being returned which  
> in this case was simply an object of Ansel_Gallery for my gallery.

Actually, we explicitly do *not* return an Ansel_Gallery object here,  
just the data that describes it's attributes since calling most of the  
Ansel_Gallery object's methods will fail outside of Ansel's scope.


>
> Also, I didn't follow the last post; it was stated that the bug in  
> Ansel was corrected but when I re installed the latest HEAD the  
> correction wasn't there so I had to patch based on what was on the  
> link you sent (Mike). Obviously I've msunderstood something.

Strange. According to cvs, the change is there:
http://cvs.horde.org/diff.php/ansel/lib/Ansel.php?r1=1.468&r2=1.469
http://cvs.horde.org/diff.php/ansel/lib/api.php?r1=1.97&r2=1.98

> Lastly; I'm unclear on how the 'page' attribute works for methods  
> like getGalleries;

What method, exactly, are you referring to?  
Ansel_Storage::getGalleries() does not take a page parameter, neither  
does the api method getGalleries().


Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

"Time just hates me. That's why it made me an adult." - Josh Joplin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: PGP Digital Signature
URL: <http://lists.horde.org/archives/ansel/attachments/20080724/7369c3e3/attachment.bin>


More information about the ansel mailing list