Critical error on "Create New User" button Critical error on "Create New User" button
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Critical error on "Create New User" button

Started by gfish, November 29, 2006, 01:03:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gfish

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?

Nibbler

Coppermine does not fully support running MySQL in strict mode.

gfish

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  :-[.

mcchristie

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 :)


gfish

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.