Skip to content

Commit

Permalink
MDL-35238 Fetch available updates using the 1.1 version of the API
Browse files Browse the repository at this point in the history
If the stored response has still 1.0 version (which is expected during
the upgrade to 2.4), a debugging message is displayed. Added a string to
explain what's going on and how to recover from the state.
  • Loading branch information
mudrd8mz committed Nov 8, 2012
1 parent 08c3bc0 commit 85d7516
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lang/en/plugin.php
Expand Up @@ -30,6 +30,7 @@
$string['checkforupdates'] = 'Check for available updates';
$string['checkforupdateslast'] = 'Last check done on {$a}';
$string['displayname'] = 'Plugin name';
$string['err_response_format_version'] = 'Unexpected version of the response format. Please try to re-check for available updates.';
$string['filterall'] = 'Show all';
$string['filtercontribonly'] = 'Show contributions only';
$string['filtercontribonlyactive'] = 'Showing contributions only';
Expand Down
4 changes: 2 additions & 2 deletions lib/pluginlib.php
Expand Up @@ -852,7 +852,7 @@ protected function validate_response($response) {
throw new available_update_checker_exception('err_response_status', $response['status']);
}

if (empty($response['apiver']) or $response['apiver'] !== '1.0') {
if (empty($response['apiver']) or $response['apiver'] !== '1.1') {
throw new available_update_checker_exception('err_response_format_version', $response['apiver']);
}

Expand Down Expand Up @@ -990,7 +990,7 @@ protected function prepare_request_url() {
if (!empty($CFG->alternativeupdateproviderurl)) {
return $CFG->alternativeupdateproviderurl;
} else {
return 'http://download.moodle.org/api/1.0/updates.php';
return 'http://download.moodle.org/api/1.1/updates.php';
}
}

Expand Down

0 comments on commit 85d7516

Please sign in to comment.