-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core: Module] Fix errors in 500-reponse logic #4193
Conversation
In fixing the above error, A 500 error would appear on the front-end and this exception was in the error log: as the code throws a This code was changed to throw a If any of that was hard to understand it's worth reviewing |
@@ -82,11 +82,11 @@ class Instrument_List extends \NDB_Menu_Filter | |||
$user =& \User::singleton(); | |||
$timePoint = $this->timePoint; | |||
if ($timePoint === null) { | |||
throw new \LorisException("Page requires a timepoint to load"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were being caught by https://github.com/aces/Loris/pull/4163/files#diff-b9919f169806c905a8606fd31442044fR304, preventing instrument_list
from loading.
@kongtiaowang can you manually test this? |
I think the |
Merging despite @xlecours's comment since the instrument list page needs the bug fix, and the feedback could be done in another PR.. |
Brief summary of changes
Instrument List crashes on
bugfix
because the$user
variable was not properly set. A TypeError is thrown byresponseStatus500()
as a result.This isn't clear from the code changes but this should fix errors like:
Fatal error: Uncaught TypeError: Argument 2 passed to Module::responseStatus500() must be an instance of User, null given, called in /home/travis/build/aces/Loris/php/libraries/Module.class.inc on line 309 and defined in /home/travis/build/aces/Loris/php/libraries/Module.class.inc:334