Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[issue_tracker] Null option in user assignees #9128

Closed
driusan opened this issue Mar 14, 2024 · 0 comments · Fixed by #9169
Closed

[issue_tracker] Null option in user assignees #9128

driusan opened this issue Mar 14, 2024 · 0 comments · Fixed by #9169
Assignees
Labels
Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label)

Comments

@driusan
Copy link
Collaborator

driusan commented Mar 14, 2024

While testing the issue_tracker module on https://test-dev-260.loris.ca (logged in as admin) there was a "null" user in the "Assignee" dropdown. (The option in the select option is the string "null".)

When trying to update an issue and assign it to that user, it results in a 500 error with the following error in the error log:

Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`test_dev_260`.`issues`, CONSTRAINT `fk_issues_2` FOREIGN KEY (`assignee`) REFERENCES `users` (`UserID`))#0 /var/www/Loris/php/libraries/Database.class.inc(577): PDOStatement->execute()\n#1 /var/www/Loris/php/libraries/Database.class.inc(508): Database->_realupdate()\n#2 /var/www/Loris/modules/issue_tracker/php/edit.class.inc(530): Database->unsafeupdate()\n#3 /var/www/Loris/modules/issue_tracker/php/edit.class.inc(38): LORIS\\issue_tracker\\Edit->_handlePOST()\n#4 /var/www/Loris/src/Middleware/UserPageDecorationMiddleware.php(247): LORIS\\issue_tracker\\Edit->handle()\n#5 /var/www/Loris/src/Middleware/PageDecorationMiddleware.php(58): LORIS\\Middleware\\UserPageDecorationMiddleware->process()\n#6 /var/www/Loris/php/libraries/NDB_Page.class.inc(725): LORIS\\Middleware\\PageDecorationMiddleware->process()\n#7 /var/www/Loris/php/libraries/Module.class.inc(321): NDB_Page->process()\n#8 /var/www/Loris/src/Middleware/ResponseGenerator.php(50): Module->handle()\n#9 /var/www/Loris/src/Middleware/AuthMiddleware.php(63): LORIS\\Middleware\\ResponseGenerator->process()\n#10 /var/www/Loris/src/Router/ModuleRouter.php(74): LORIS\\Middleware\\AuthMiddleware->process()\n#11 /var/www/Loris/src/Middleware/ExceptionHandlingMiddleware.php(54): LORIS\\Router\\ModuleRouter->handle()\n#12 /var/www/Loris/src/Router/BaseRouter.php(132): LORIS\\Middleware\\ExceptionHandlingMiddleware->process()\n#13 /var/www/Loris/src/Middleware/ResponseGenerator.php(50): LORIS\\Router\\BaseRouter->handle()\n#14 /var/www/Loris/src/Middleware/ContentLength.php(52): LORIS\\Middleware\\ResponseGenerator->process()\n#15 /var/www/Loris/htdocs/index.php(73): LORIS\\Middleware\\ContentLength->process()\n#16 {main}, referer: https://test-dev-260.loris.ca/issue_tracker/issue/29

There are 2 problems that are related:

  1. There was no swal indicating that something went wrong
  2. The option should not have been in the dropdown.
@driusan driusan added the Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) label Mar 14, 2024
driusan pushed a commit that referenced this issue Mar 27, 2024
- Force an internal server error JSON response on db update error, which allows to actually see front-end swal error.
- Fix bug where there was a "null" userID assignee in the options (causing an error if selected)

Fixes #9128
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants