Page 1 of 1

Create users without a firstname

Posted: Wed Jun 10, 2015 4:03 pm
by blokje
Hello,

I have a problem. we are an International company and we have employees without a firstname (yes that is at least possible in Indonesia).
Is there any way to accomplish this? The Rest API refuses the create the user (as by design).
Tried a space but that is also not accepted.

(We use version 3.0)

Hans

Re: Create users without a firstname

Posted: Thu Jun 28, 2018 3:45 pm
by andreaadamczyk
Hello blokje,

Currently, ProcessMaker does not support this kind of user creation, but you could first create a user with a number or another nonspecial character instead of a first name.

I have created a user that has a number instead of a first name and it worked fine.

You can also modify the tables RBAC_USERS and USERS in the database, setting the first name as an empty string after the creation of the users.

I hope this helps you.

Best Regards.

Re: Create users without a firstname

Posted: Thu Jun 28, 2018 9:14 pm
by amosbatto
blokje,
If you are using the createUser() web service, then edit workflow/engine/classes/class.wsBase.php:1150 and change from:
Code: Select all
            if (empty( $firstName )) {
To:
Code: Select all
            if (empty( $firstName ) and empty($lastName)) {
If you are using the POST /user REST endpoint to create the user, then edit workflow/engine/src/ProcessMaker/BusinessModel/User.php:9 and change from:
Code: Select all
        "USR_FIRSTNAME"        => array("type" => "string", "required" => true,  "empty" => false, "defaultValues" => array(),                                               "fieldNameAux" => "usrFirstname"),
To:
Code: Select all
        "USR_FIRSTNAME"        => array("type" => "string", "required" => true,  "empty" => true, "defaultValues" => array(),                                               "fieldNameAux" => "usrFirstname"), 
After making those changes, it should be possible to create a user whose first name is an empty string.