Menu

#737 Cannot create a new user

Unknown
pending
None
Unknown
Unkown
Unknown
Unknown
Unknown
Unknown
2026-02-20
2026-02-18
No

Hi,
I am trying to add new users as a superuser.
I log in, click Users > Add.
After filling in the form and pressing Add
I get an error message:
This page isn’t working right now
<webpage> can't currently handle this request.
HTTP ERROR 500
What is wrong?</webpage>

Discussion

  • Mikhail Mikhailov

    Addition: The error obviosly comes from this line in the php script:
    $this->formData['creatorId'] = \UTF8\mb_trim($this->vars['creatorId']);

     

    Last edit: Mikhail Mikhailov 2026-02-18
  • Mark Grimshaw

    Mark Grimshaw - 2026-02-18

    Hello Mikhail,

    Sorry to hear you are having problems—thank you for reporting.

    1. Can you duplicate here the exact username you are trying to enter?
    2. On the form for adding the new user, do you see this message?
      "Because email is enabled, a new user will be emailed a link inviting them to enter their own password."
      Or are you able to enter their password yourself?

    Mark

     
  • Mikhail Mikhailov

    Hello Mark,

    Can you duplicate here the exact username you are trying to enter?
    julia

    On the form for adding the new user, do you see this message?
    "Because email is enabled, a new user will be emailed a link inviting them to enter their own
    password."
    No.
    And, as far as I understand, email is not emabled.
    "Enable mail operations": No
    Or are you able to enter their password yourself?
    Yes, I am.

     
  • Mikhail Mikhailov

    Hi again,
    I forgot to mention that the program is installed on a Red Hat server and I am using it online.
    Version 6.12.1.
    Php 8.2

     
    • Mark Grimshaw

      Mark Grimshaw - 2026-02-18

      Thanks Mikhail.

      PHP and WIKINDX version match mine. I added a user 'julia' without email enabled entering just password and email address—the user was created without issues.

      Are you adding other details (the second row of the form)?

       
  • Mikhail Mikhailov

    I tried both ways - with all details and only first row -- no difference.
    In Firefox browser I get a blank page, in Edge I get the error message "This page isn’t working right now". And the user name does not matter, I tried different. And with different passwords.

     

    Last edit: Mikhail Mikhailov 2026-02-19
  • Mark Grimshaw

    Mark Grimshaw - 2026-02-19

    OK. A 500 error can be quite unspecific as to its cause.

    Can you try the following please?

    1. Turn on error reporting in WIKINDX: Admin|Configure . . . Debugging "Print PHP errors and warnings to the screen." Is there now a more specific error message on the screen when you try to add a user?
    2. Check for error messages in the server's error log.

    Mark

     
  • Mikhail Mikhailov

    Hi,

    Here are the error messages:

    Warning: Undefined array key "creatorId" in /var/www/html/wikindx/core/modules/admin/ADMINUSER.php on line 1024

    Fatal error: Uncaught TypeError: UTF8\mb_trim(): Argument #1 ($string) must be of type string, null given, called in /var/www/html/wikindx/core/modules/admin/ADMINUSER.php on line 1024 and defined in /var/www/html/wikindx/core/libs/UTF8.php:213 Stack trace: #0 /var/www/html/wikindx/core/modules/admin/ADMINUSER.php(1024): UTF8\mb_trim() #1 /var/www/html/wikindx/core/modules/admin/ADMINUSER.php(214): ADMINUSER->validateInput() #2 /var/www/html/wikindx/index.php(124): ADMINUSER->add() #3 {main} thrown in /var/www/html/wikindx/core/libs/UTF8.php on line 213

     
    • Mark Grimshaw

      Mark Grimshaw - 2026-02-20

      Thank you Mikhail.

      That helps and I now think I know what is happening. Do you have the 'User is creator' select box in the add user form? I suspect not (i.e. you have no resources added or resources with creators).

      Mark

       
  • Mikhail Mikhailov

    No, I don't.

     
  • Mark Grimshaw

    Mark Grimshaw - 2026-02-20

    OK. The following should fix the issue then (I assume you have access to the code):

    Replace the line at 1024 with:

            if (array_key_exists('creatorId', $this->vars)) {
                $this->formData['creatorId'] = $this->vars['creatorId'];
            }
    

    And, so you don't have the same issue editing a user, do the same with the line at 1106.

    That should do the trick. The issue is my fault—I didn't check for the existence of resources with creators when adding/editing users. If you have such resources, you can then assign the new user as being the same as one of the creators of a resource (opening up further search and browse options).

    Let me know if it works please and then I will commit the change.

    Mark

     
  • Mark Grimshaw

    Mark Grimshaw - 2026-02-20
    • status: open --> pending
    • assigned_to: Mark Grimshaw
     

Log in to post a comment.

MongoDB Logo MongoDB