Skip to content

Commit 3260c3c

Browse files
authored
Merge pull request #630 from ucfopen/dev/v2-8-2
2.8.2 - Fix for bogging down scanning larger courses
2 parents 809ccc9 + 3952008 commit 3260c3c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

config/settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
define('ENV_PROD', 'prod');
44
define('ENV_DEV', 'dev');
55

6-
define('UDOIT_VERSION', '2.8.0');
6+
define('UDOIT_VERSION', '2.8.2');
77

88
// SET UP AUTOLOADER (uses autoload rules from composer)
99
require_once(__DIR__.'/../vendor/autoload.php');

lib/Udoit.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,14 @@ protected static function apiGetAllLinks($api_key, $url)
553553
$results = [];
554554
$cur_page = 1;
555555
do {
556-
$response = static::apiGet("{$url}&page=1&per_page={$per_page}", $api_key)->send();
556+
if (strpos($url, 'page=') === false) {
557+
$url .= "&page={$cur_page}";
558+
}
559+
if (strpos($url, 'per_page=') === false) {
560+
$url .= "&per_page={$per_page}";
561+
}
562+
563+
$response = static::apiGet($url, $api_key)->send();
557564
if (isset($response->body->errors) && count($response->body->errors) > 0) {
558565
foreach ($response->body->errors as $error) {
559566
$logger->addError("Canvas API responded with an error for {$url}: $error->message");

0 commit comments

Comments
 (0)