Loris: [user_accounts] get 500 error when submitting new user account

Created on 13 May 2019  路  6Comments  路  Source: aces/Loris

When submitting a new user account, the user IS created but front-end shows 500 error.

To re-create, fill out the following:

  • username
  • first + last name
  • password + confirm
  • email address + confirm
  • site
Bug

All 6 comments

i've tried this twice and not getting this error :/

My suspicion is that the 500 error is caused when using the generate password functionality in conjunction with send email to user. Since we do not have an email server setup, an error is thrown.

Observations:

  • When creating the account with normal password entry, there is no error.
  • When creating an account with normal password entry, but selecting send email to user, an error is thrown.

Thus, marking this as dependent on #4515. Will re-test after email server is setup.

[Mon May 13 15:11:52.997031 2019] [php7:notice] [pid 17233] [client 70.81.209.39:56096] PHP Notice: Undefined index: ID in /var/www/loris/php/libraries/User.class.inc on line 213, referer: https://test.loris.ca/user_accounts/edit_user/
[Mon May 13 15:11:53.231938 2019] [php7:error] [pid 17233] [client 70.81.209.39:56096] PHP Fatal error: Uncaught TypeError: uniqid() expects parameter 1 to be string, integer given in /var/www/loris/php/libraries/Email.class.inc:78\nStack trace:\n#0 /var/www/loris/php/libraries/Email.class.inc(78): uniqid(1557774713)\n#1 /var/www/loris/modules/user_accounts/php/edit_user.class.inc(535): Email::send('rida.loris@gmai...', 'edit_user.tpl', Array)\n#2 /var/www/loris/php/libraries/NDB_Form.class.inc(162): LORIS\user_accounts\Edit_User->_process(Array)\n#3 /var/www/loris/php/libraries/LorisForm.class.inc(1438): NDB_Form->_save(Array)\n#4 /var/www/loris/php/libraries/NDB_Form.class.inc(133): LorisForm->process(Array)\n#5 /var/www/loris/php/libraries/NDB_Form.class.inc(190): NDB_Form->save()\n#6 /var/www/loris/modules/user_accounts/php/edit_user.class.inc(562): NDB_Form->handle(Object(Zend\Diactoros\ServerRequest))\n#7 /var/www/loris/src/Middleware/UserPageDecorationMiddleware.php(171): LORIS\user_accounts\Edit_User->handle(Object(Zend\Diactoros\ServerRequest))\n#8 /var/www/loris/src/Middleware/PageDecorationMiddleware.php(49): in /var/www/loris/php/libraries/Email.class.inc on line 78, referer: https://test.loris.ca/user_accounts/edit_user/

@ridz1208 @kongtiaowang @jesscall The issue Rida encountered in the stack trace should've been resolved with this PR: https://github.com/aces/Loris/pull/4331/files#diff-afc080cfab0a9186d9fd2cfb4f51aa5eR78 that was merged 3 days ago.

The Test VM needs to pull the latest changes from major. After that the emails might work as that TypeError won't occur and cause LORIS to crash.

I can reproduce this issue but in a different condition:
if you forget a field like Examiner status, try to save, get an error message, then correct the form, then try save again : results in 500 message.
Password is entered (twice) and 'send email to user' unchecked so it's not a generate password error.

However if I fill the form out without an error (again w password, not checking 'sent email to user') it's fine, no 500 error.

I've re-tested with conditions from my previous comment and am no longer getting a 500 error. This is presumably because test VM now has the latest changes from major and email server has been setup.

@christinerogers I've attempted reproducing the error you got but don't get the same results. Can you test again and see if you are still getting 500 error?

Otherwise, I think this issue can be closed.

Was this page helpful?
0 / 5 - 0 ratings