phpgroupware-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-tracker] [bug #3563] problem in transfering records when


From: nobody
Subject: [Phpgroupware-tracker] [bug #3563] problem in transfering records when deleting a user
Date: Thu, 03 Jul 2003 15:36:51 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313

=================== BUG #3563: LATEST MODIFICATIONS ==================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3563&group_id=509

Changes by: Ralf Becker <address@hidden>
Date: Thu 07/03/2003 at 21:36 (Europe/Berlin)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
This has been fixed in CVS and should be available in the next
release.



=================== BUG #3563: FULL BUG SNAPSHOT ===================


Submitted by: totschnig               Project: phpGroupWare                 
Submitted on: Mon 05/12/2003 at 21:39
Category:  API - Admin                Bug Group:  0.9.14 release            
Severity:  4                          Priority:  None                       
Resolution:  Fixed                    Assigned to:  ralfbecker              
Status:  Closed                       Component Version:  CVS               
Platform Version:  None               Reproducibility:  None                

Summary:  problem in transfering records when deleting a user

Original Submission:  When I tried to use the option to transfer records to 
another user when deleting a user I get the followin error:

Database error: Invalid SQL: UPDATE phpgw_cal_user SET cal_login=7 WHERE 
cal_id=7 AND cal_login=19
MySQL Error: 1062 (Duplicate entry '7-7' for key 1)

File: /usr/local/www/phpgroupware.src/calendar/inc/class.socalendar.inc.php
Line: 243

Session halted.

Follow-up Comments
*******************

-------------------------------------------------------
Date: Thu 07/03/2003 at 21:36       By: ralfbecker
This has been fixed in CVS and should be available in the next
release.

-------------------------------------------------------
Date: Mon 06/02/2003 at 01:52       By: totschnig
Hello Rainer,

I found the solution, 
after the
 $db2->query('SELECT count(*) FROM phpgw_cal_user WHERE cal_id='.$id.' AND 
cal_login='.$new_owner,__LINE__,__FILE__);
you need a
$db2->next_record();
!!


-------------------------------------------------------
Date: Sat 05/31/2003 at 11:05       By: ralfbecker
Hi Michael,

I cant understand how this bug can happen, as the attached code from the 
socalendar-class already checks if the new_owner is already participating and 
only changes the participant-record to the new_owner if he is not else the 
record gets just delete. Do you still have that record and can send me dump of 
it (everything from tables phpgw_cal and phpgw_cal_users for cal_id=7)

Cheers Ralf

PS.: That file has not changed since the first .14 release

function change_owner($account_id,$new_owner)
{
        if($GLOBALS['phpgw_info']['server']['calendar_type'] == 'sql')
        {
                $db2 = $this->cal->stream;
                $this->cal->stream->query('SELECT cal_id FROM phpgw_cal_user 
WHERE cal_login='.$account_id,__LINE__,__FILE__);
                while($this->cal->stream->next_record())
                {
                        $id = $this->cal->stream->f('cal_id');
                        $db2->query('SELECT count(*) FROM phpgw_cal_user WHERE 
cal_id='.$id.' AND cal_login='.$new_owner,__LINE__,__FILE__);
                        if($db2->f(0) == 0)
                        {
                                $db2->query('UPDATE phpgw_cal_user SET 
cal_login='.$new_owner.' WHERE cal_id='.$id.' AND 
cal_login='.$account_id,__LINE__,__FILE__);
                        }
                        else
                        {
                                $db2->query('DELETE FROM phpgw_cal_user WHERE 
cal_id='.$id.' AND cal_login='.$account_id,__LINE__,__FILE__);
                        }
                }
                $this->cal->stream->query('UPDATE phpgw_cal SET 
owner='.$new_owner.' WHERE owner='.$account_id,__LINE__,__FILE__);
        }
}



CC list is empty


No files currently attached


For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3563&group_id=509

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]