6.0.0-beta1
7/9/25

[#6564] "Photos not found" error in lib/Ansel.php
Summary "Photos not found" error in lib/Ansel.php
Queue Ansel
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester tinu (at) humbapa (dot) ch
Created 04/03/2008 (6306 days ago)
Due
Updated 04/12/2008 (6297 days ago)
Assigned 04/09/2008 (6300 days ago)
Resolved 04/12/2008 (6297 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/12/2008 02:36:53 PM Michael Rubinsky Comment #4
State ⇒ Resolved
Reply to this comment
Alright. I finally see what your referring to, I think.  I still don't 
see where you would get an error  "pop-up in a new window".   
getImages() was just returning a PEAR_Error - and that error was only 
being logged to the horde log...that's it.



Your point is valid though about returning an error when image count 
== 0, but I have fixed it somewhat differently.  IMO, a getImages() 
method shouldn't care at all, or even have to know about, any 
subgalleries. I changed the method to return an empty array() in that 
case which makes more sense to me.  I also changed the if-clause in 
getChildren() to only call getImages() if we actually have any images. 
This will save an additional database query for each page since we 
already load the image count when we instantiate the gallery object.



http://lists.horde.org/archives/cvs/Week-of-Mon-20080407/077308.html



Thanks for the report.
04/12/2008 01:36:13 PM tinu (at) humbapa (dot) ch Comment #3 Reply to this comment
Are you sure you are using the latest CVS code?
yes
If you are running latest CVS, please give a detailed
description of how to reproduce (what gallery style you are using,
what exact page the error is thrown on etc...)
I'm using the default settings when I add a gallery. the error

occurs when I view the main gallery. e.g.:

http://www.humbapa.ch/horde/ansel/view.php?view=Gallery&gallery=2

(the PEAR-error should popup in a new window)
The image tiles in the gallery views are actually obtained via
Ansel_Gallery::getChildren() - which (should) take into account any
subgalleries before it calls getImages().
getChildren() only calls getImages() if there is room for some more 
images. so, if there is room (e.g. only 1 subgallery) getImages() 
returns "Photos not found" if there aren't any more photos. this error 
message is correct, but from my view it doesn't make much sense to 
raise an error if there are subgalleries with photos. maybe one could 
log that with PEAR_NOTICE...
04/09/2008 06:35:21 PM Michael Rubinsky Comment #2
State ⇒ Feedback
Reply to this comment
Are you sure you are using the latest CVS code?  I cannot reproduce 
this. Just about *all* of my top-level galleries contain nothing but 
sub-galleries.  If you are running latest CVS, please give a detailed 
description of how to reproduce (what gallery style you are using, 
what exact page the error is thrown on etc...)



The image tiles in the gallery views are actually obtained via 
Ansel_Gallery::getChildren() - which (should) take into account any 
subgalleries before it calls getImages().
04/03/2008 08:44:58 AM Jan Schneider State ⇒ Assigned
Assigned to Michael Rubinsky
 
04/03/2008 07:29:00 AM tinu (at) humbapa (dot) ch Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ "Photos not found" error in lib/Ansel.php
Queue ⇒ Ansel
Milestone ⇒
Patch ⇒ No
New Attachment: Ansel.php.patch Download
State ⇒ Unconfirmed
Reply to this comment
I have some galleries without images but with subgalleries. every time 
I view such a gallery I got an errormessage saying "Photos not found".



the methode getImages in lib/Ansel.php checks if there are any images 
inside a gallery an returns "PEAR::raiseError(_("Photos not found"));" 
for 0 images. my small patch changes that behaviour so that the error 
only occurs for 0 images and no subgalleries.



thanks!

Saved Queries