patch for Group.php

Paul Cooper pgc@ucecom.com
Thu, 6 Dec 2001 18:51:31 -0500


---------------------- multipart/mixed attachment
So, like a fool, I started playing with groups. 

In scripts/db/category.sql there's everyones old favourite -- # thing.
 
In the indexes we have something like

CREATE INDEX category_category_name_idx ON horde_categories 
(category_name(10))

the (10) doesn't seem to be supported in postgres - in other db's does 
that mean it only indexes the first 10 characters? If you take the (10) 
out it works in postgres - I guess you could get the same result in 
postgres with a functional index, but I doubt it's worth it at this stage.

I put together a test script to play with a group object and found an 
error in the Category/sql.php - see attaced patch - the word 'as' was 
missing twice in the sql statement.

Paul

-- 
-----------------------------------------------------------------
Paul Cooper                             |  Tel: 0121 331 7858
Senior Programmer and Database Engineer |  Fax: 0121 331 7859
UCEcom                                  |  mailto:pgc@ucecom.com
University of Central England           |  http://www.ucecom.com
Birmingham, B4 7DX                      |
-----------------------------------------------------------------

---------------------- multipart/mixed attachment
Index: sql.php
===================================================================
RCS file: /repository/horde/lib/Category/sql.php,v
retrieving revision 1.10
diff -u -r1.10 sql.php
--- sql.php	15 Nov 2001 16:58:14 -0000	1.10
+++ sql.php	6 Dec 2001 18:35:46 -0000
@@ -138,7 +138,7 @@
      */
     function fullyload()
     {
-        $query = sprintf('SELECT t.category_name name, t2.category_name category_id_parent FROM %s t, %s t2, %s cp' .
+        $query = sprintf('SELECT t.category_name as name, t2.category_name as category_id_parent FROM %s t, %s t2, %s cp' .
                          ' WHERE t.group_uid=%s AND cp.category_id_parent=t2.category_id AND cp.category_id_child=t.category_id' .
                          ' AND t2.group_uid=%s ',
                          $this->params['table'], $this->params['table'], $this->params['tableRelations'],

---------------------- multipart/mixed attachment--