-
Notifications
You must be signed in to change notification settings - Fork 179
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
[NDB_BVL_Instrument_LINST] Add Metadata Fields after adding to dictionary #9667
base: main
Are you sure you want to change the base?
Conversation
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.
This was complicated !
but - Yes it makes sense to call _addMetaDataFields after building the dictionary !
However, I am getting an error, as follows :
[Tue Mar 04 19:31:14.362177 2025] [php:error] [pid 15578] [client 192.168.122.1:56428] PHP Fatal error: Uncaught TypeError: NDB_BVL_InstrumentStatus_ControlPanel::__construct(): Argument #2 ($testname) must be of type string, null given, called in /var/www/loris/php/libraries/NDB_BVL_Instrument.class.inc on line 2797 and defined in /var/www/loris/php/libraries/NDB_BVL_InstrumentStatus_ControlPanel.class.inc:57\nStack trace:\n#0 /var/www/loris/php/libraries/NDB_BVL_Instrument.class.inc(2797): NDB_BVL_InstrumentStatus_ControlPanel->__construct()\n#1 /var/www/loris/src/Middleware/UserPageDecorationMiddleware.php(266): NDB_BVL_Instrument->getControlPanel()\n#2 /var/www/loris/src/Middleware/PageDecorationMiddleware.php(59): LORIS\\Middleware\\UserPageDecorationMiddleware->process()\n#3 /var/www/loris/php/libraries/NDB_Page.class.inc(731): LORIS\\Middleware\\PageDecorationMiddleware->process()\n#4 /var/www/loris/php/libraries/NDB_BVL_Instrument.class.inc(3236): NDB_Page->process()\n#5 /var/www/loris/modules/instruments/php/module.class.inc(97): NDB_BVL_Instrument->process()\n#6 /var/www/loris/src/Middleware/ResponseGenerator.php(51): LORIS\\instruments\\Module->handle()\n#7 /var/www/loris/src/Middleware/AuthMiddleware.php(64): LORIS\\Middleware\\ResponseGenerator->process()\n#8 /var/www/loris/src/Router/ModuleRouter.php(75): LORIS\\Middleware\\AuthMiddleware->process()\n#9 /var/www/loris/src/Middleware/ExceptionHandlingMiddleware.php(55): LORIS\\Router\\ModuleRouter->handle()\n#10 /var/www/loris/src/Router/BaseRouter.php(138): LORIS\\Middleware\\ExceptionHandlingMiddleware->process()\n#11 /var/www/loris/src/Middleware/ResponseGenerator.php(51): LORIS\\Router\\BaseRouter->handle()\n#12 /var/www/loris/src/Middleware/ContentLength.php(53): LORIS\\Middleware\\ResponseGenerator->process()\n#13 /var/www/loris/htdocs/index.php(74): LORIS\\Middleware\\ContentLength->process()\n#14 {main}\n thrown in /var/www/loris/php/libraries/NDB_BVL_InstrumentStatus_ControlPanel.class.inc on line 57, referer: https://adaudrich-dev.loris.ca/instrument_list/?candID=300001&sessionID=1
] | ||
); | ||
} else { | ||
if ($this->DataEntryType!=="DirectEntry") { |
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.
if ($this->DataEntryType!=="DirectEntry") { | |
// The sequence of if statements below building the data dictionary is designed to | |
// mimic the same logic in the _addMetadataFields() function of | |
// NDB_BVL_Instrument to keep the dictionary in sync with the fields added | |
// to the form, make sure to modify it accordingly | |
if ($this->DataEntryType!=="DirectEntry") { |
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.
@saagar, small suggestion. I would also suggest adding a similar statement at the top of metadata fields in case someone decides to modify that part and forgets this
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.
@ridz1208 -- think you have the wrong person!
@skarya22 I have not tested it but I will help Adam give it a test. For the changes themselves, I think its good enough for a bugfix. I do think a better fix is warranted for the next release and it could come with a slight refactor of some of the convoluted logic in this class. |
@adamdaudrich Can you let me know what you were trying to do when you received that error so I can recreate it? I can't find that error |
I got the controlPanel() error when loading bmi.linst. It essentially means control panel is not getting a testname (type: string). |
@adamdaudrich that's strange, I am able to open the bmi instrument from candidate profile with no errors :/ I opened |
Brief summary of changes
WHEN REVIEWING THIS PR, PRESS THE GEAR ICON, THEN HIDE WHITESPACE
Testing instructions (if applicable)
Link(s) to related issue(s)