6.0.0-alpha12
6/7/25

[#6200] Store image count
Summary Store image count
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/05/2008 (6332 days ago)
Assigned 02/04/2008 (6333 days ago)
Resolved 02/04/2008 (6333 days ago)
Milestone
Patch No

History
02/05/2008 04:44:17 PM Michael Rubinsky Comment #6 Reply to this comment
Yea, looks like the patch didn't find that chunk due to the earlier 
changes.  Anyway, fixed the select statement and also fixed an issue 
that was preventing  the image counts from actually being updated in 
the DB on image addition.  The database was updated, but we were not 
setting our local copy of the data, so that when we call 
Ansel_Gallery::set() later on to set the last_modified time, it was 
being over written with the old value.
02/05/2008 08:04:59 AM Duck Comment #5
New Attachment: Ansel-images.diff Download
Reply to this comment
Changed method name to updateImageCount() and committed, along with
upgrade scripts and neccesary change to the ansel.sql creation script.
You forgot to add the gallery_images column list in the selection. 
Without it the galleries list shows no images.
02/04/2008 08:54:24 PM Michael Rubinsky Comment #4
State ⇒ Resolved
Reply to this comment
Changed method name to updateImageCount() and committed, along with 
upgrade scripts and neccesary change to the ansel.sql creation script.



Thanks!
02/04/2008 01:28:10 PM Duck Comment #3
New Attachment: 2008_02_02_image_count.php Download
Reply to this comment
we need an upgrade script to set the  initial values.
This won't work with all dbs as it uses subselect. Is just to see what 
it should be.
02/04/2008 01:02:46 PM Chuck Hagenbuch Comment #2
State ⇒ Assigned
Assigned to Michael Rubinsky
Reply to this comment
Looks pretty good to me. The method should be updateImageCount (or 
Counts), not ImagesCount, and we need an upgrade script to set the 
initial values.
02/04/2008 12:24:53 PM Duck Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Store image count
Queue ⇒ Ansel
New Attachment: Ansel.diff Download
State ⇒ New
Reply to this comment
For every gallery display we are counting the number of images. This 
means at least 9 additional queries par page (for pref default, and no 
gallery has no sub-gallery, otherwise even more).  Avoid this, update 
the number of images into gallery_images column when images are 
manipulated.

Saved Queries