Skip to content

Commit

Permalink
Merge pull request #9 from innocampus/drop-moodle-3
Browse files Browse the repository at this point in the history
Require at least Moodle 4.1; remove use of deprecated function (fixes #5)
  • Loading branch information
daniil-berg authored Apr 10, 2024
2 parents 0388940 + fb7906f commit e87e22d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
moodle-branch: [MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE]
moodle-branch: [MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE]
database: [pgsql, mariadb]
# See: https://moodledev.io/general/development/policies/php
exclude:
Expand All @@ -41,14 +41,6 @@ jobs:
moodle-branch: MOODLE_403_STABLE
- php: '8.0'
moodle-branch: MOODLE_403_STABLE
- php: '8.1'
moodle-branch: MOODLE_311_STABLE
- php: '8.1'
moodle-branch: MOODLE_400_STABLE
- php: '8.2'
moodle-branch: MOODLE_311_STABLE
- php: '8.2'
moodle-branch: MOODLE_400_STABLE
- php: '8.2'
moodle-branch: MOODLE_401_STABLE

Expand Down
11 changes: 3 additions & 8 deletions classes/course_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,9 @@ public function get_file_list($offset, $limit) {
$sqlwhere .= ' AND ' . $this->get_sql_mimetype($this->filterfiletype, true);
}

if (class_exists('\core_user\fields')) {
$usernameselect = implode(', ', array_map(function($field) {
return 'u.' . $field;
}, \core_user\fields::get_name_fields()));
} else {
// For compatibility with Moodle 3.9.
$usernameselect = get_all_user_name_fields(true, 'u');
}
$usernameselect = implode(', ', array_map(function($field) {
return 'u.' . $field;
}, \core_user\fields::get_name_fields()));

$sql = "FROM {files} f
LEFT JOIN {context} c ON (c.id = f.contextid)
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
defined('MOODLE_INTERNAL') || die;

$plugin->version = 2022060800;
$plugin->requires = 2016051900;
$plugin->requires = 2022112800; // Require at least Moodle 4.1.0.
$plugin->cron = 0;
$plugin->component = "local_listcoursefiles";
$plugin->maturity = MATURITY_STABLE;
Expand Down

0 comments on commit e87e22d

Please sign in to comment.