[Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
SVN 6820 Fresh Install: Create "super user" as Medical Consultant role (_a_0_all) and assign all depts. Login as "super user" Create a new patient first as person: Although data gets saved in the table with the correct PID, an error is raised that "an invalid PID caused the data not to be saved i

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Robert Meggle
Hi Muthu, Register or admit a patient? ;-) Please take look on revision 6812. I found that dongling else as well this afternoon and just moved it to a status that the message what you describe here will be shown (before that it fall into script error that smarty class is not assigned... worse).

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Robert Meggle
Hi, Am Dienstag, den 28.09.2010, 23:41 +0530 schrieb Ap.Muthu: > It appears that the lines 462 to 464 are a dangling orphan "else" construct > with no parent "if". no.. there is a parent "if" for that closing bracket: Line 247: if($validdata) ... Robert -- -- ---

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Robert Meggle
Hi, Fixed now with revision 6822. Am Dienstag, den 28.09.2010, 23:41 +0530 schrieb Ap.Muthu: > SVN 6820 Fresh Install: > Create "super user" as Medical Consultant role (_a_0_all) and assign all > depts. > Login as "super user" > Create a new patient first as person: > Although data gets saved in

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
Further investigation reveals that the value of $create_id at line 458 in the said file: include/care_api_classes/class_gui_person_show.php is empty (NULL) for the first person entry. This will make the value of $buffer empty (NULL) as well. At this point only $glob_obj->config['person_id_nr_init

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Robert Meggle
Hi Muthu, Am Mittwoch, den 29.09.2010, 01:21 +0530 schrieb Ap.Muthu: > Further investigation reveals that the value of $create_id at line 458 in > the said file: > include/care_api_classes/class_gui_person_show.php > is empty (NULL) for the first person entry. > This will make the value of $buffe

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Robert Meggle
Hi, Am Dienstag, den 28.09.2010, 22:18 +0200 schrieb Robert Meggle: > Hi Muthu, > > Am Mittwoch, den 29.09.2010, 01:21 +0530 schrieb Ap.Muthu: > > Further investigation reveals that the value of $create_id at line 458 in > > the said file: > > include/care_api_classes/class_gui_person_show.php >

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
Hi Robert, Files from SVN 6821 and 6822 used. The extra "{' (opening curly brace) has been traced to one present in a commented out statement. The bug still remains. The photo gets saved as 0.png / 0.gif / 0.jpg in /uploads/photos/registration folder At that place (line 458), $buffer remai

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Robert Meggle
Hi Muthu, Yes, I know. It has not closed that issue. This is a really heavy bug... It happen always to the very first pid. Then it seems to be ok.. Wow.. now going through all the files and see where the pid will be transported by 0 records of care_person. Well, the entry will be done in care_pe

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
Line 42 in /modules/registration_admmission/patient_register_show.php is: $person = & new GuiPersonShow; Should we do away with the "&"? Does it make a difference? > Hi Muthu, > > Yes, I know. It has not closed that issue. This is a really heavy bug... > It happen always to the very first pid. T

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
Just before line 42, $_SESSION['pid'] = 0 $_POST is blank $_REQUEST[' pid'] = 0 > Line 42 in /modules/registration_admmission/patient_register_show.php is: > $person = & new GuiPersonShow; > Should we do away with the "&"? > Does it make a difference? > > >> Hi Muthu, >> >> Yes, I know. It has no

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Robert Meggle
Hi Muthu, the & here is a object as reference. Depreciated by php 5.3 or higher. Could bring issues (empty vars). But not for the thing we are hunting now (first record in care_person) Robert Am Mittwoch, den 29.09.2010, 03:05 +0530 schrieb Ap.Muthu: > Line 42 in /modules/registration_admmissio

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Robert Meggle
Hi Am Mittwoch, den 29.09.2010, 03:23 +0530 schrieb Ap.Muthu: > Just before line 42, > $_SESSION['pid'] = 0 > $_POST is blank > $_REQUEST[' pid'] = 0 That's ok, no problem. But maybe I found the issue, but not the solution. class_gui_input_person.php, after line 311 the section start where a new

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
Hi Robert, You are right. At the time of first correct data insertion, pid will get it'svalue from the config table parameter value of 1000. Hence we must investigate the code just after the insert. It has to be in class_gui_input_person.php. Also note the commenting out of the $_SESSION va

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
File: class_gui_input_person.php Line 308 $_POST variable contents: Array ( [date_reg] => 2010-09-29 06:44:02 [title] => Mr. ...[create_time] => 20100929064402 [pid] => 1000 ) This shows that the variable %_POST['pid'] gets populated correctly but the variable $pid still remai

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
Inserting: $_SESSION['sess_pid'] = $_POST['pid']; at line 308 does the job! > File: class_gui_input_person.php > Line 308 > $_POST variable contents: > Array > ( >[date_reg] => 2010-09-29 06:44:02 >[title] => Mr. > ...[create_time] => 20100929064402 >[pid] => 1000 > )

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
Sorry, insert at Line 302. Committed SVN 6824. > Inserting: > $_SESSION['sess_pid'] = $_POST['pid']; > > at line 308 does the job! > > >> File: class_gui_input_person.php >> Line 308 >> $_POST variable contents: >> Array >> ( >>[date_reg] => 2010-09-29 06:44:02 >>[title] => Mr. >>

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
Hi Robert, You're right This is an ADOdb / MySQL issue. This will affect all tables with no records = for their first insertion - the $db->Insert_ID() will fail! This could be an issue ever since we changed to ADOdb v5.11 Or alternatively, in an InnoDB table, when we force it to accept a differe

Re: [Care2002-developers] SVN 6820 - Error on First Person Add

2010-09-28 Thread Ap.Muthu
http://bugs.mysql.com/bug.php?id=27033 Suggested fix: Go back to Version 5.0.27 or work around by first INSERTing and after that SELECTing (more expensive). Alternatively, make the insert function with a NULL Primary Key during insert into an auto increment field. This function may clash when w