Error when creating a new user
Hello,
I have a strange problem when creating a new user.
In the Admin Panel, I try to add a user.
I enter all the details and click «Save».
Normally, an overview is shown with all the metadata about the user.
But I only see the titles/names of the attributes, the values are all empty.
The user is not added to the database.
The user page is, hower, created.
In the table wacko_user_setting, there is a setting for a user with the user_id 0, and in the Admin Panel under «Database inconsistencies», it reports a user setting without a user.
When I enable PHP Error Display and create the user, the error message tell me that in the admin/modul/user_users.php all the variables are missing values.
I'm on version 6.1.29. Something seems to be wrong with my installation.
With a fresh version 6.2.0 it works, I assume with a fresh version 6.1.29 it also works.
I tried copying all the installation files from a fresh download of 6.1.29 (and copying my config and file/ folder there).
This did not help, so the problem must lie in my configuration.
Can anyone point me in the right direction to solve this?
Re: Error when creating a new user
If you wanna know what went wrong, turn on error reporting including setting
DB_ERROR_MODEto1or2.It will show you in the error_log or the Exception message what failed.
You can check if your
usertable is OK and up to date. Maybe there is a missing default value or the like causing an SQL Strict mode issue.What database and database version are you using, MySQL or MariaDB?
You can check why the SQL query which should INSERT the new user is failing.
Can you register a new user via the
registrationaction?If not it is probably the user table.
[2] Upgrade to the latest version (6.1.29 → 6.2.1)
Most SQL queries have been rewritten. No changes to the tables.
Aw: Error when creating a new user
I think the error is before the insert/update into the DB, because PHP itself gives the following error messages regarding undefined variables.
The registration email however is sent to the user.
I am using MariaDB.
Actually yes, that worked, thanks for the hint. The user appears in the table.
I would love to upgrade, in fact, I did. But this did not solve the problem. Also in fresh installation of 6.1.29 obviously user creation from the admin panel works fine, but after importing the backup the error happens again.
So the error only seems to be in the admin panel «Users» page, not in the registration action
Re: Error when creating a new user
Then try to create a new account. It should throw a Fatal error message.
All indicates that the
INSERTquery for the new user regarding theusertable fails. Now is the question WHY?It is possible that the restored user table structure is inconsistent.
Does the
registrationaction also work after you restored your backup?Aw: Error when creating a new user
Now i got an error, that user_ip has no default value set.
I set it to '' in MariaDB, and the user creation from admin panel now works normally.
I don't know how I got into that state (missing default value).
Wouldn't a database check catch that? The db check from the admin panel reported no errors.
So, it works, thank you very much for your help and input!
So in the end my assumption (that the error happens in the application) was wrong and your inital comment regarding missing default value was spot on.
For context I can answer your questions:
1. + 2. Yes, I mean the integrated backup/restore from admin panel.
3. I restored both
4. I tried both, the backup was taken in 6.1.29 and then restored once to same version, and afterwards also restored into 6.2.0 or 6.2.1, not sure anymore. It generally worked fine in the higher versions, but my error did persist (of course).
Thanks again!
Re: Error when creating a new user
That is how there was suddenly a missing default value. This was fixed with WackoWiki 6.1.10.
[2] SQL Strict mode
DEFAULTvalues forNOT NULLcolumns duringINSERT.DEFAULTis not mandatory unless explicitly configured.In both databases, the enforcement is governed by the
sql_modesetting. IfSTRICT_TRANS_TABLESorSTRICT_ALL_TABLESis active,NOT NULLcolumns withoutDEFAULTvalues must be explicitly included inINSERTstatements.You can change the SQL Strict mode in WackoWiki via the
sql_modein the primary setting.0– server SQL mode (default)1– lax2– strictclass Dbal
constants.php
config.php
Thanks for the feedback.