Package: egroupware
Version: 1.6.001+dfsg-2
Severity: normal
Tags: upstream


This bug has also been Identified in upstream 1.6.003.

If a user has distribution lists, upon entering addressbook and selecting a 
distribution list,
user gets an error like:

SELECT egw_addressbook.*,n_given,n_given<>'' FROM egw_addressbook  JOIN 
egw_addressbook2list 
ON egw_addressbook.contact_id=egw_addressbook2list.contact_id AND list_id=66 
LEFT JOIN egw_accounts 
ON egw_addressbook.account_id=egw_accounts.account_id WHERE contact_tid='n' 
AND (egw_addressbook.contact_owner=142 OR contact_private=0 AND 
egw_addressbook.contact_owner IN (140,11,142,0) 
OR egw_addressbook.contact_owner IS NULL) AND (account_expires IS NULL OR 
account_expires = -1 OR account_expires > 1275977177) 
ORDER BY n_given<>'' DESC,n_given ASC,n_family ASC,org_name ASC

ERROR:  ORDER BY "n_given" is ambiguous
LINE 1: ...t_expires > 1275977177) ORDER BY n_given<>'' DESC,n_given AS...


Looking at the lighttpd log file we get something like

2010-06-08 11:44:24: (mod_fastcgi.c.2711) FastCGI-stderr: Database error: 
Invalid SQL: SELECT egw_addressbook.*,n_family,n_family<>'' FROM 
egw_addressbook  JOIN egw_addressbook2list ON 
egw_addressbook.contact_id=egw_addressbook2list.contact_id AND list_id=57 LEFT 
JOIN egw_accounts ON egw_addressbook.account_id=egw_accounts.account_id WHERE 
contact_tid='n' AND (egw_addressbook.contact_owner=8 OR contact_private=0 AND 
egw_addressbook.contact_owner IN (140,11,8,0) OR egw_addressbook.contact_owner 
IS NULL) AND (account_expires IS NULL OR account_expires = -1 OR 
account_expires > 1275986664) ORDER BY n_family<>'' DESC,n_family ASC,n_given 
ASC,org_name ASC:
ERROR:  ORDER BY "n_family" is ambiguous
LINE 1: ..._expires > 1275986664) ORDER BY n_family<>'' DESC,n_family A...
                                                             ^
                                                             #0 
/usr/share/egroupware/phpgwapi/inc/class.egw_db.inc.php(684): 
egw_db->halt('Invalid SQL: SE...', 860, '/usr/share/egro...')
                                                             #1 
/usr/share/egroupware/phpgwapi/inc/class.egw_db.inc.php(1913): 
egw_db->query('SELECT egw_addr...', 860, '/usr/share/egro...', 0, 23, false, 2)
                                                             #2 
/usr/share/egroupware/etemplate/inc/class.so_sql.inc.php(861): 
egw_db->select('egw_addressbook', 'egw_addressbook...', Array, 860, 
'/usr/share/egro...', 0, 'ORDER BY n_fami...', 'phpgwapi', 23, ' JOIN 
egw_addre...')
                                                             #3 
/usr/share/egroupware/addressbook/inc/class.addressbook_sql.inc.php(417): 
so_sql->search('', 'egw_addressbook...', 'n_family<>'' DE...', Array, '%', 
false, 'OR', Array, Array, ' JOIN egw_addre...', NULL)
                                                             #4 
/usr/share/egroupware/addressbook/inc/class.addressbook_so.inc.php(628): 
addressbook_sql->search('', false, 'n_family<>'' DE...', '', '%', false, 'OR', 
Array, Array, '', NULL)
                                                             #5 
/usr/share/egroupware/addressbook/inc/class.addressbook_ui.inc.php(953): 
addressbook_so->search('', false, 'n_family<>'' DE...', '', '%', false, 'OR', 
Array, Array)
                                                             #6 
/usr/share/egroupware/etemplate/inc/class.nextmatch_widget.inc.php(320): 
addressbook_ui->get_rows(Array, Array, NULL)
                                                             #7 
/usr/share/egroupware/etemplate/inc/class.boetemplate.inc.php(529): 
nextmatch_widget->pre_process('exec[nm]', Array, Array, Array, Array, 
Object(etemplate))
                                                             #8 
/usr/share/egroupware/etemplate/inc/class.etemplate.inc.php(1012): 
boetemplate->extensionPreProcess('nextmatch', 'exec[nm]', Array, Array, Array)
                                                             #9 
/usr/share/egroupware/etemplate/inc/class.etemplate.inc.php(803): 
etemplate->show_cell(Array, Array, Array, 'exec', 0, 2, 'all', '', '/0/3A')
                                                             #10 
/usr/share/egroupware/etemplate/inc/class.etemplate.inc.php(1349): 
etemplate->show_grid(Array, Array, Array, 'exec', 0, 0, '/0')
                                                             #11 
/usr/share/egroupware/etemplate/inc/class.etemplate.inc.php(609): 
etemplate->show_cell(Array, Array, Array, 'exec', 0, 0, '', NULL, '/0')
                                                             #12 
/usr/share/egroupware/etemplate/inc/class.etemplate.inc.php(220): 
etemplate->show(Array, Array, Array, 'exec')
                                                             #13 
/usr/share/egroupware/addressbook/inc/class.addressbook_ui.inc.php(344): 
etemplate->exec('addressbook.add...', Array, Array, NULL, Array, 0)
                                                             #14 
/usr/share/egroupware/index.php(110): addressbook_ui->index()
                                                             #15 {main}

Looking at the trace back in the line #5 where the order is defined, we see 
that we have immediately those lines case statements of the form

$order = "n_family<>'' DESC,n_family $sort,n_given $sort,org_name $sort";

these should be changed as below

$order = "egw_addressbook.n_family<>'' DESC,egw_addressbook.n_family 
$sort,n_given $sort,org_name $sort";

Following that, all works fine depending on the sorting selected before going 
into the distribution list.


I havent included a diff as it is an upstream problem which may be fixed in the 
development versions ...

-Carl Kigundu


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (700, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-3-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages egroupware depends on:
ii  egroupware-addressbook    1.6.001+dfsg-2 web-based groupware suite - addres
ii  egroupware-bookmarks      1.6.001+dfsg-2 web-based groupware suite - bookma
ii  egroupware-calendar       1.6.001+dfsg-2 web-based groupware suite - calend
ii  egroupware-core           1.6.001+dfsg-2 web-based groupware suite - core m
ii  egroupware-developer-tool 1.6.001+dfsg-2 web-based groupware suite - develo
ii  egroupware-emailadmin     1.6.001+dfsg-2 web-based groupware suite - e-mail
ii  egroupware-etemplate      1.6.001+dfsg-2 web-based groupware suite - widget
ii  egroupware-felamimail     1.6.001+dfsg-2 web-based groupware suite - e-mail
ii  egroupware-filemanager    1.6.001+dfsg-2 web-based groupware suite - file m
ii  egroupware-infolog        1.6.001+dfsg-2 web-based groupware suite - infolo
ii  egroupware-manual         1.6.001+dfsg-2 web-based groupware suite - manual
ii  egroupware-news-admin     1.6.001+dfsg-2 web-based groupware suite - news a
ii  egroupware-notifications  1.6.001+dfsg-2 web-based groupware suite - notifi
ii  egroupware-phpbrain       1.6.001+dfsg-2 web-based groupware suite - phpbra
ii  egroupware-phpsysinfo     1.6.001+dfsg-2 web-based groupware suite - phpSys
ii  egroupware-polls          1.6.001+dfsg-2 web-based groupware suite - pollin
ii  egroupware-projectmanager 1.6.001+dfsg-2 web-based groupware suite - projec
ii  egroupware-registration   1.6.001+dfsg-2 web-based groupware suite - regist
ii  egroupware-resources      1.6.001+dfsg-2 web-based groupware suite - resour
ii  egroupware-sambaadmin     1.6.001+dfsg-2 web-based groupware suite - Samba 
ii  egroupware-sitemgr        1.6.001+dfsg-2 web-based groupware suite - site m
ii  egroupware-timesheet      1.6.001+dfsg-2 web-based groupware suite - timesh
ii  egroupware-tracker        1.6.001+dfsg-2 web-based groupware suite - tracke
ii  egroupware-wiki           1.6.001+dfsg-2 web-based groupware suite - wiki a

egroupware recommends no packages.

egroupware suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to