Skip to content

[23.0][survey_accounts] 500 error when starting visit that surveys have been surveys have been created #7162

@CamilleBeau

Description

@CamilleBeau

Describe the bug
After creating a survey, starting the visit that that survey belongs to gives the following 500 error:

[Wed Dec 02 11:29:57.977649 2020] [php7:warn] [pid 7173] [client 192.168.122.1:32854] PHP Warning: Invalid argument supplied for foreach() in /var/www/loris/php/libraries/LorisForm.class.inc on line 1319, referer: https://ccna-test.loris.ca/next_stage/?candID=389332&sessionID=4661&identifier=4661 [Wed Dec 02 11:29:58.110963 2020] [php7:error] [pid 7173] [client 192.168.122.1:32854] PHP Fatal error: Uncaught Exception: Battery is not empty - will not clobber an existing battery. in /var/www/loris/php/libraries/NDB_BVL_Battery.class.inc:140\nStack trace:\n#0 /var/www/loris/modules/next_stage/php/next_stage.class.inc(124): NDB_BVL_Battery->createBattery(1, 'Visit', 'Neuropsychology...', 1, false)\n#1 /var/www/loris/php/libraries/NDB_Form.class.inc(157): LORIS\\next_stage\\Next_Stage->_process(Array)\n#2 /var/www/loris/php/libraries/LorisForm.class.inc(1432): NDB_Form->_save(Array)\n#3 /var/www/loris/php/libraries/NDB_Form.class.inc(128): LorisForm->process(Array)\n#4 /var/www/loris/php/libraries/NDB_Form.class.inc(187): NDB_Form->save()\n#5 /var/www/loris/src/Middleware/UserPageDecorationMiddleware.php(234): NDB_Form->handle(Object(Laminas\\Diactoros\\ServerRequest))\n#6 /var/www/loris/src/Middleware/PageDecorationMiddleware.php(56): LORIS\\Middleware\\UserPageDecorationMiddleware->process(Object(Laminas\\Diactoros\\ServerRequest), Object(LORIS\\next_stage\\Next_Stage))\n#7 /var/www/loris/php/libraries/NDB_Page.class.inc(692 in /var/www/loris/php/libraries/NDB_BVL_Battery.class.inc on line 140, referer: https://ccna-test.loris.ca/next_stage/?candID=389332&sessionID=4661&identifier=4661

To Reproduce
Steps to reproduce the behavior (attach screenshots if applicable):

  1. Set isDirectEntry=true for an instrument in test_names
  2. In survey accounts, create a survey for a visit that has not been started yet.
  3. Go to the timepoint list for the candidate that you created the survey for
  4. Try to start the visit that was chosen for the survey
  5. See error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category: BugPR or issue that aims to report or fix a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions