Error when creating a new user

5

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?

Comments

  1. Re: Error when creating a new user

    [1] Debugging

    If you wanna know what went wrong, turn on error reporting including setting DB_ERROR_MODE to 1 or 2.
    const DB_ERROR_MODE		= 1;
    const PHP_ERROR_REPORTING	= 6;	

    It will show you in the error_log or the Exception message what failed.

    You can check if your user table 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 registration action?
    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.
    • WikiAdmin
    • 03/10/2026 11:28 edited
  2. Aw: Error when creating a new user

    Debugging

    I think the error is before the insert/update into the DB, because PHP itself gives the following error messages regarding undefined variables.


    PHP Warning:  Undefined variable $user in /wiki/admin/module/user_users.php on line 687
    PHP Warning:  Trying to access array offset on value of type null in /wiki/admin/module/user_users.php on line 687
    PHP Warning:  Undefined variable $user in /wiki/admin/module/user_users.php on line 702
    PHP Warning:  Trying to access array offset on value of type null in /wiki/admin/module/user_users.php on line 702[...]	


    The registration email however is sent to the user.

    I am using MariaDB.

    Can you register a new user via the registration action?

    Actually yes, that worked, thanks for the hint. The user appears in the table.

    [2] Upgrade to the latest version (6.1.29 → 6.2.1)

    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
    • hatho
    • 03/10/2026 20:59 edited
  3. Re: Error when creating a new user

    The error log indicate no related error. Please set 
    const DB_ERROR_MODE		= 2;	


    Then try to create a new account. It should throw a Fatal error message.
    All indicates that the INSERT query for the new user regarding the user table fails. Now is the question WHY?

    1. What kind of backup?
    2. Was the backup created and restored with the backup and restore module in the admin panel?
    3. Did you restore only data or also the table structure?
    4. Was the WackoWiki version of the backup the same of the WackoWiki you restored it in?

    It is possible that the restored user table structure is inconsistent.

    Does the registration action also work after you restored your backup?
    • WikiAdmin
    • 03/10/2026 21:29 edited
  4. Aw: Error when creating a new user

    Thanks, I set DB_ERROR_MODE to 1 before, now I set it to 2. Should have done that from the beginning.

    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!
    • hatho
    • 03/10/2026 21:50 edited
  5. Re: Error when creating a new user

    [1] The culprit

    1. The DEFAULT value was always set from the beginning.
    2. However the backup script did not stored the DEFAULT in some cases.

    That is how there was suddenly a missing default value. This was fixed with WackoWiki 6.1.10.

    [2] SQL Strict mode

    • MySQL 5.7 made strict mode default, effectively requiring DEFAULT values for NOT NULL columns during INSERT.
    • MariaDB never enables strict mode by default, so DEFAULT is not mandatory unless explicitly configured.
    • SQLite 3.37.0 introduced a STRICT tables feature, but does not support SQL Strict modes.

    In both databases, the enforcement is governed by the sql_mode setting. If STRICT_TRANS_TABLES or STRICT_ALL_TABLES is active, NOT NULL columns without DEFAULT values must be explicitly included in INSERT statements.

    You can change the SQL Strict mode in WackoWiki via the sql_mode in the primary setting.
    • 0 – server SQL mode (default)
    • 1 – lax 
    • 2 – strict

    class Dbal
    <?php
    
    // change the current SQL mode at runtime
    $sql_modes = match((int) $this->sql_mode) {
        1        => SQL_MODE_LAX[$this->db_vendor],
        2        => SQL_MODE_STRICT[$this->db_vendor],
        default    => 0, // server SQL mode
    };
    
    if ($sql_modes)
    {
        $this->db->query("SET SESSION sql_mode = '$sql_modes'");
    }


    constants.php
    const SQL_MODE_STRICT	= [
    	'mariadb'	=> 'TRADITIONAL,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY',
    	'mysql'		=> 'TRADITIONAL,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY'
    ];
    const SQL_MODE_LAX	= [
    	'mariadb'	=> 'NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER',
    	'mysql'		=> 'NO_ENGINE_SUBSTITUTION'
    ];	


    config.php
    'sql_mode' => '0',	


    Thanks for the feedback.
    • WikiAdmin
    • 03/11/2026 09:26 edited
Log in or create an account to post a comment.