6.0.0-alpha12
6/7/25

[#6201] Remember if a gallery has a subgallery
Summary Remember if a gallery has a subgallery
Queue Ansel
Type Enhancement
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester duck (at) obala (dot) net
Created 02/04/2008 (6333 days ago)
Due
Updated 02/06/2008 (6331 days ago)
Assigned
Resolved 02/06/2008 (6331 days ago)
Milestone
Patch No

History
02/06/2008 07:50:47 PM Michael Rubinsky Comment #6
State ⇒ Resolved
Reply to this comment
Upgrade script now works too.

Use two seperate loops for the image counts and subgalleries flag. 
Getting the galleries with image counts won't return galleries that 
contain *only* subgalleries (as most of mine do).




02/05/2008 09:34:28 PM Michael Rubinsky Comment #5 Reply to this comment
You can select all gallery_share_id-s and for each of them create a
share object and  run and update the hasChilden() result.
Sure, but this, too, is causing problems. It is returning false for 
every gallery.
02/05/2008 06:54:55 PM Duck Comment #4 Reply to this comment
I've got the code to handle this committed, although I'm having
difficulty with an upgrade script. I think there might be an issue
somewhere with either Ansel_Shares::listShares() or
Ansel_Storage::countShares()  in that only galleries that are one
level DOWN from datatree_root are being recognized as having
subgalleries....I've got to dig more, but have to run for now.
You can select all gallery_share_id-s and for each of them create a 
share object and  run and update the hasChilden() result. This will 
ensure you get all the subgallery levels.
02/05/2008 06:37:10 PM Michael Rubinsky Comment #3 Reply to this comment
I've got the code to handle this committed, although I'm having 
difficulty with an upgrade script. I think there might be an issue 
somewhere with either Ansel_Shares::listShares() or 
Ansel_Storage::countShares()  in that only galleries that are one 
level DOWN from datatree_root are being recognized as having 
subgalleries....I've got to dig more, but have to run for now.
02/04/2008 05:43:53 PM Michael Rubinsky Comment #2
State ⇒ Accepted
Assigned to Michael Rubinsky
Reply to this comment
Make sense to me....putting it on my pile :)
02/04/2008 02:00:00 PM Duck Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Remember if a gallery has a subgallery
Queue ⇒ Ansel
New Attachment: Ansel-sub.diff Download
State ⇒ New
Reply to this comment
Like in Bug #6200 when we track the number of images. Here we mark if 
gallery has any sub-galleries when a share is added/removed. This 
avoid additional queries in browsing when getting the sub-galleries 
list to count the images inside a gallery. As galleries mostly does 
not have sub-galleries this this will commonly avoid 9 queries.

Saved Queries