Loris icon indicating copy to clipboard operation
Loris copied to clipboard

[cbig][instrument/statistics] Dashboard redirection to statistics works but result table is empty

Open regisoc opened this issue 10 months ago • 8 comments

Describe the bug

Clicking the incomplete forms link inside the LORIS dashboard works but goes to an empty table. During testing lots of errors are printed in the logs but nothing on the UI.

image

image

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

  1. Go to Dashboard/main page > click the right hand side incomplete form.
  2. See error

regisoc avatar May 02 '24 15:05 regisoc

This is expected since CBIG does not use instrument tables while the stats module expects it

ridz1208 avatar May 04 '24 01:05 ridz1208

Ok, thanks. Is it a non issue? Widget should be deactivated?

regisoc avatar May 06 '24 14:05 regisoc

@regis, module should be deactivated if you ask me but maybe?

ridz1208 avatar May 06 '24 16:05 ridz1208

What do you mean "does not use instrument tables while the stats module expects it"? Does the stats module not work with json data?

driusan avatar May 06 '24 19:05 driusan

@driusan Unless I'm missing something in the code, some special case, no it doesnt sem like it. it literally joins on the table in the SQL query.

ridz1208 avatar May 06 '24 19:05 ridz1208

That doesn't make sense. The completion status is on the flag table, not the instrument table. It looks like it's just doing it to do WHERE i.CommentID NOT LIKE 'DDE%' but that can just as easily be done with the CommentID from the flag table (which is used to join the instrument table in the first place.)

driusan avatar May 06 '24 19:05 driusan

actually the inner join is implicitly filtering out other instruments too, but that can be done with the test_name on the flag table.

driusan avatar May 06 '24 20:05 driusan

@driusan I'm not saying it cant be fixed, I'm saying its not working currently thats it

ridz1208 avatar May 07 '24 12:05 ridz1208

Tested it, not a same issue anymore: redirects to a 500. image

This is the log:

PHP Fatal error:  Uncaught TypeError: LORIS\\statistics\\Statistics_Site::_checkCriteria(): Argument #1 ($centerID) must be of type CenterID, string given, called in /var/www/Loris/modules/statistics/php/statistics_site.class.inc on line 189 and defined in /var/www/Loris/modules/statistics/php/statistics_site.class.inc:97\nStack trace:\n#0 /var/www/Loris/modules/statistics/php/statistics_site.class.inc(189): LORIS\\statistics\\Statistics_Site->_checkCriteria()\n#1 /var/www/Loris/modules/statistics/php/statistics_site.class.inc(277): LORIS\\statistics\\Statistics_Site->_completeCount()\n#2 /var/www/Loris/php/libraries/NDB_Page.class.inc(741): LORIS\\statistics\\Statistics_Site->setup()\n#3 /var/www/Loris/src/Middleware/UserPageDecorationMiddleware.php(247): NDB_Page->handle()\n#4 /var/www/Loris/src/Middleware/PageDecorationMiddleware.php(58): LORIS\\Middleware\\UserPageDecorationMiddleware->process()\n#5 /var/www/Loris/php/libraries/NDB_Page.class.inc(725): LORIS\\Middleware\\PageDecorationMiddleware->process()\n#6 /var/www/Loris/php/libraries/Module.class.inc(321): NDB_Page->process()\n#7 /var/www/Loris/src/Middleware/ResponseGenerator.php(50): Module->handle()\n#8 /var/www/Loris/src/Middleware/AuthMiddleware.php(63): LORIS\\Middleware\\ResponseGenerator->process()\n#9 /var/www/Loris/src/Router/ModuleRouter.php(74): LORIS\\Middleware\\AuthMiddleware->process()\n#10 /var/www/Loris/src/Middleware/ExceptionHandlingMiddleware.php(54): LORIS\\Router\\ModuleRouter->handle()\n#11 /var/www/Loris/src/Router/BaseRouter.php(132): LORIS\\Middleware\\ExceptionHandlingMiddleware->process()\n#12 /var/www/Loris/src/Middleware/ResponseGenerator.php(50): LORIS\\Router\\BaseRouter->handle()\n#13 /var/www/Loris/src/Middleware/ContentLength.php(52): LORIS\\Middleware\\ResponseGenerator->process()\n#14 /var/www/Loris/htdocs/index.php(73): LORIS\\Middleware\\ContentLength->process()\n#15 {main}\n  thrown in /var/www/Loris/modules/statistics/php/statistics_site.class.inc on line 97, referer: https://rongarocarcy-dev.loris.ca/

@driusan CenterID not initialized to a defined \CenterID object here. Do we have a default site? The same kind might happen for ProjectID too.

regisoc avatar Sep 24 '24 14:09 regisoc

Resolved by https://github.com/aces/Loris/pull/9252, new issue to be created for Regis's last comment

CamilleBeau avatar Sep 24 '24 14:09 CamilleBeau