Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Critical error on "Create New User" button  (Read 27358 times)

0 Members and 1 Guest are viewing this topic.

gfish

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Critical error on "Create New User" button
« on: November 29, 2006, 01:03:27 am »

Having just installed CPG and finally getting everything to work (I thought), I was dismayed when I hit the "Create new user" button and a critical error message appeared. Adding a user through the normal email approval process worked fine. Turning on debugging gave the following additional information for this error:

Critical Error
There was an error while processing a database query.
While executing query "INSERT INTO cpg1410_users(user_regdate, user_active) VALUES (NOW(), 'YES')" on 0
mySQL error: Field 'user_profile6' doesn't have a default value
File: C:\Inetpub\wwwroot\coppermine\include\functions.inc.php - Line: 249


Column user_profile6 (default "Biography") in the cpg1410_Users table is field type text, which cannot be null, nor can it have a default value, but in usermgr.php no value for it is supplied on the new_user INSERT statement (at line 818 in my installation). I changed the statement from

cpg_db_query("INSERT INTO {$CONFIG['TABLE_USERS']}(user_regdate, user_active) VALUES (NOW(), 'YES')");

to

cpg_db_query("INSERT INTO {$CONFIG['TABLE_USERS']}(user_regdate, user_active, user_profile6) VALUES (NOW(), 'YES', 'profile6')");

which fixed the problem. I'm not including the rather lengthy debugging info because I don't believe it would add value to the critical error message.

Am I the only one who has experienced this problem?
« Last Edit: August 19, 2007, 11:59:27 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Critical error on "Create New User" button
« Reply #1 on: November 29, 2006, 02:25:00 am »

Coppermine does not fully support running MySQL in strict mode.
Logged

gfish

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Critical error on "Create New User" button
« Reply #2 on: November 29, 2006, 03:24:25 am »

Thanks Nibbler  :). I'm a retired programmer familiar with DBMS and SQL programming (mainframe, AS/400, Windows workstation), but I'm new to both MySQL and PHP  ???. The MySQL server instance configuration wizard showed that I did set up MySQL in strict mode, but the Coppermine debug info did not (if I interpreted it correctly, see attachment). I changed it using the MySQL wizard, and now the original usermgr.php now works just fine.  Thanks for not flaming me  :-[.
Logged

mcchristie

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Critical error on "Create New User" button
« Reply #3 on: February 17, 2007, 12:19:10 pm »

i've also had this issue... hence why i just registered :)

i'm not quite as good with code as the OP, can someone please explain how i can fix this (i.e. which file i have to edit and with what code)?

edit - i apologise for being a bit stupid, i've amended the code in the usermgr file and works for me too :)

Logged

gfish

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Critical error on "Create New User" button
« Reply #4 on: February 17, 2007, 08:44:11 pm »

Go to Start/All Programs/MySQL/My SQL Server 5.0/MySQL Server Instance Config Wizard, and on the panel with "Enable TCP/IP Networking" and "Enable Strict Mode", uncheck the "Enable Strict Mode" box.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 18 queries.