Skip to content
Permalink
Browse files

Fixed issue #15752: 500 error when accessing staticstics on a survey

  • Loading branch information
eddylackmann committed Feb 14, 2020
1 parent 1e913e8 commit 3bd4d8560b53acd2c5bc30319184f1ee1e84e844
Showing with 5 additions and 3 deletions.
  1. +4 −2 application/controllers/admin/statistics.php
  2. +1 −1 application/helpers/common_helper.php
@@ -156,9 +156,11 @@ public function run($surveyid = 0, $subaction = null)
* b) "groups" -> group_name + group_order *
*/

//store all the data in $rows
$rows = Question::model()->with('group')->findAll(array('condition' => 'parent_qid = 0 AND group.sid=' . $surveyid, 'order' => 'group_order,question_order'));

$rows = Question::model()
->with(array('group' => array('alias' => 'g')))
->findAll(array('condition' => 'parent_qid = 0 AND g.sid=' . $surveyid, 'order' => 'group_order,question_order'));

//SORT IN NATURAL ORDER!
usort($rows, 'groupOrderThenQuestionOrder');

@@ -4359,7 +4359,7 @@ function fixSubquestions()
*/
function ls_json_encode($content)
{
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() && is_string($content)) {
if (is_string($content)) {
$content = stripslashes($content);
}
$ans = json_encode($content);

0 comments on commit 3bd4d85

Please sign in to comment.
You can’t perform that action at this time.