Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Replace low level $db->Concat() calls to Moodle sql_concat() cross-db…

… alternative. MDL-13823 ; backported from HEAD
  • Loading branch information...
commit 49022d40e16ffeee00bbaa7da864db7fc0af36db 1 parent c40ff34
stronk7 authored

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. +6 6 lib/statslib.php
12 lib/statslib.php
@@ -593,33 +593,33 @@ function stats_get_parameters($time,$report,$courseid,$mode,$roleid=0) {
593 593 break;
594 594
595 595 case STATS_REPORT_READS:
596   - $param->fields = $db->Concat('timeend','roleid').' AS uniqueid, timeend, roleid, stat1 as line1';
  596 + $param->fields = sql_concat('timeend','roleid').' AS uniqueid, timeend, roleid, stat1 as line1';
597 597 $param->fieldscomplete = true; // set this to true to avoid anything adding stuff to the list and breaking complex queries.
598 598 $param->aggregategroupby = 'roleid';
599 599 $param->stattype = 'activity';
600 600 $param->crosstab = true;
601 601 $param->extras = 'GROUP BY timeend,roleid,stat1';
602 602 if ($courseid == SITEID) {
603   - $param->fields = $db->Concat('timeend','roleid').' AS uniqueid, timeend, roleid, sum(stat1) as line1';
  603 + $param->fields = sql_concat('timeend','roleid').' AS uniqueid, timeend, roleid, sum(stat1) as line1';
604 604 $param->extras = 'GROUP BY timeend,roleid';
605 605 }
606 606 break;
607 607
608   - case STATS_REPORT_WRITES:
609   - $param->fields = $db->Concat('timeend','roleid').' AS uniqueid, timeend, roleid, stat2 as line1';
  608 + case STATS_REPORT_WRITES:
  609 + $param->fields = sql_concat('timeend','roleid').' AS uniqueid, timeend, roleid, stat2 as line1';
610 610 $param->fieldscomplete = true; // set this to true to avoid anything adding stuff to the list and breaking complex queries.
611 611 $param->aggregategroupby = 'roleid';
612 612 $param->stattype = 'activity';
613 613 $param->crosstab = true;
614 614 $param->extras = 'GROUP BY timeend,roleid,stat2';
615 615 if ($courseid == SITEID) {
616   - $param->fields = $db->Concat('timeend','roleid').' AS uniqueid, timeend, roleid, sum(stat2) as line1';
  616 + $param->fields = sql_concat('timeend','roleid').' AS uniqueid, timeend, roleid, sum(stat2) as line1';
617 617 $param->extras = 'GROUP BY timeend,roleid';
618 618 }
619 619 break;
620 620
621 621 case STATS_REPORT_ACTIVITY:
622   - $param->fields = $db->Concat('timeend','roleid').' AS uniqueid, timeend, roleid, sum(stat1+stat2) as line1';
  622 + $param->fields = sql_concat('timeend','roleid').' AS uniqueid, timeend, roleid, sum(stat1+stat2) as line1';
623 623 $param->fieldscomplete = true; // set this to true to avoid anything adding stuff to the list and breaking complex queries.
624 624 $param->aggregategroupby = 'roleid';
625 625 $param->stattype = 'activity';

0 comments on commit 49022d4

Please sign in to comment.
Something went wrong with that request. Please try again.