bugphpGroupWare - Bugs: bug #6602, invalid sql and incorrect error...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #6602: invalid sql and incorrect error message when ldap server not available with postgres 7.3

Submitted by:  brad langhorst <bwlang>
Submitted on:  Mon 17 Nov 2003 02:04:07 PM UTC  
 
Item Group: 0.9.14.007 releaseCategory: API - phpGroupware API
Severity: 3 - NormalPriority: 5 - Normal
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: SVNOperating System: GNU/Linux - Debian
Reproducibility: Every TimePlanned Release: None
Fixed Release: 

Mon 17 Nov 2003 02:16:36 PM UTC, comment #1:

This has been fixed in CVS and should be available in the next
release.

Dave Hall <skwashd>
Project Administrator
Mon 17 Nov 2003 02:04:07 PM UTC, original submission:

the problem is that the error logger attempts to insert
'' into an integer field for the current userid.
This is invalid sql in recent versions of postgres.

Here's a simple patch to put in an invalid uid instead of ''
With this patch applied the actual problem is displayed instead of an sql error.

diff -u -r1.11 class.errorlog.inc.php
--- class.errorlog.inc.php 12 Jan 2002 22:12:40 -0000 1.11
+++ class.errorlog.inc.php 17 Nov 2003 13:58:34 -0000
@@ -106,9 +106,15 @@
{
$db = $GLOBALS['phpgw']->db;
// $db->lock('phpgw_log');
+ // make sure that account_id is not ''
+ if ($GLOBALS['phpgw']->session->account_id == '') {
+ $account_id = -1;
+ } else {
+ $account_id = $GLOBALS['phpgw']->session->account_id;
+ }
$db->query("insert into phpgw_log (log_date, log_user, log_app, log_severity) values "
."('". $GLOBALS['phpgw']->db->to_timestamp(time())
- ."','".$GLOBALS['phpgw']->session->account_id
+ ."','".$account_id
."','".$GLOBALS['phpgw_info']['flags']['currentapp']."'"
.",'".$this->severity()."'"
.")"

brad langhorst <bwlang>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 17 Nov 2003 02:16:36 PM UTCskwashdStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1