Skip to content

Commit

Permalink
Activity completion data source table loaded issue fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
raja-lmsace committed Jul 18, 2024
1 parent f1d6eaf commit 4970a3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
15 changes: 0 additions & 15 deletions classes/local/dash_framework/query_builder/builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,21 +449,6 @@ public function query() {
return $DB->get_records_sql($sql, $params, $this->get_limitfrom(), $this->get_limitnum());
}


/**
* Return the all records from this query
*
* @return array
* @throws dml_exception
* @throws exception\invalid_operator_exception
*/
public function get_all_records_query() {
global $DB;

[$sql, $params] = $this->get_sql_and_params();
return $DB->get_records_sql($sql, $params);
}

/**
* Get number of records this query will return.
*
Expand Down
18 changes: 3 additions & 15 deletions classes/local/data_source/abstract_data_source.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ abstract class abstract_data_source implements data_source_interface, \templatab
*/
private $tables = [];

/**
* @var int
*/
protected $count;

/**
* Constructor.
*
Expand Down Expand Up @@ -187,11 +182,11 @@ public function get_paginator(): paginator {

if ($this->paginator == null) {
$this->paginator = new paginator(function () {
$this->count = $this->get_data_records_count();
$count = $this->get_query()->count();
if ($maxlimit = $this->get_max_limit()) {
return $maxlimit < $this->count ? $maxlimit : $this->count;
return $maxlimit < $count ? $maxlimit : $count;
}
return $this->count;
return $count;
}, 0, $perpage);
}

Expand Down Expand Up @@ -724,11 +719,4 @@ public function is_widget() {
return false;
}

/**
* Get a data source table records count
*/
public function get_data_records_count() {
return $this->get_query()->count();
}

}

0 comments on commit 4970a3d

Please sign in to comment.