Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQL error when adding user
#1
I've got a new installation and it's exhibiting this symptom:

http://www.opendocman.com/forum/viewtopi...+user#p292

I tried the set sql_mode statement mentioned in another post and thought it was corrected but I was wrong, the issue is stil present today.
mysql> SET sql_mode = '';

I do notice that the user record does get created - I can retrieve it in subsequent queries, but it seems to be missing some of the data I filled in originally and that needs to be re-entered and resubmitted.

thanks,
Owen
#2
Are you getting the same "Integer for ID" error message?
#3
Here's the specific error message message I get when adding a new user:
Error in query: INSERT INTO odm_admin (id, admin) VALUES('7', ''). Incorrect integer value: '' for column 'admin' at row 1

The address bar shows "commitchange.php"

thanks much,
Owen
#4
Ok, around line 82 of commitchange.php change the line by adding a zero:

Change:
$_POST['admin']='';

To:

$_POST['admin']='0';

Let me know if this resolves your issue.
#5
Yes, that fixed the "add user" error. But then I immediately ran into another, similar, error. I added a user, then created a department, and attempted to change the new user to be in the newly created department and got this error:

Error in query: UPDATE odm_admin set admin='no' where id = '8'. Incorrect integer value: 'no' for column 'admin' at row 2

thanks,
Owen
#6
Update to previous post - the error occurs on the newly created user. I am able to change (without error) the department of users that existed prior to instituting the fix. Since I'm still in test mode, maybe I should flush the database and start from scratch? What would be the easiest way to do that?
#7
Change 'no' to '0' (zero).
#8
Also remove line 51:

$_REQUEST['admin']='no';

I am applying these fixes to my local version and will be adding them to the next release.
#9
What about lines the references to the value of admin in lines 133, 135, 144?
thanks,
Owen
#10
My line numbers are a little different because of some other changes I made, but in summary there are 3 changes:

1) Remove the following line near 49:
Code:
$_REQUEST['admin']='no';


2) Near line 79 change (add a zero in between the quotes):
Code:
if (!isset($_POST['admin']))
        {
                $_POST['admin']='';
        }

Change To:

Code:
if (!isset($_POST['admin']))
        {
                $_POST['admin']='0';
        }

3) Near line 135 change (replace 'no' with '0' )
Code:
if(!isset($_POST['admin']) || $_POST['admin'] == '')
    {
            $_POST['admin'] = 'no';
    }

Change To:

Code:
if(!isset($_POST['admin']) || $_POST['admin'] == '')
    {
            $_POST['admin'] = '0';
    }

Are there other spots that you were thinking needed to be changed?


Forum Jump:


Users browsing this thread: 1 Guest(s)