From 735c271f2edbc1824954cb7d422f19e5b83e1fe7 Mon Sep 17 00:00:00 2001 From: Michael Milette Date: Mon, 14 Oct 2024 16:19:58 -0400 Subject: [PATCH] Refactorig code. --- CHANGELOG.md | 1 + README.md | 1 + invitation_form.php | 7 +++++-- version.php | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc0e0e5..e8e6f04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. - Added option to automatically add instance to new courses. ### Updated - Fixed support for plain text tag called {$a->userfullname}. +- Fixed compatibility issue with Moodle versions prior to v3.11. - Fixed deprecation notice running on PHP 8.3. ## [2.2.1] - 2024-04-28 diff --git a/README.md b/README.md index 6e38043..6ea729c 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,7 @@ Michael Milette - Author and Lead Developer Big thank you to the following contributors. (Please let me know if I forgot to include you in the list): +* Chandra Kishor (developerck) - Fixed compatibility issue with Moodle versions prior to v3.11. * Phillip Fickl (phillipfickl) - Add instance to new coures by default. (2023) * MSVermet - Case insensitive comparison between invitation email and user email. (2023) * [Jerome Mouneyrac](http://www.moodleitandme.com) for his work on the original [invitation enrollment plug-in](https://github.com/mouneyrac/moodle-enrol_invitation) in which this one is based upon. diff --git a/invitation_form.php b/invitation_form.php index 2998e69..4825c55 100755 --- a/invitation_form.php +++ b/invitation_form.php @@ -397,8 +397,11 @@ public function definition() { } else { $userfields = get_extra_user_fields($context); } - // this line is causing issue for system lower than version 311 - // $userfields = \core_user\fields::get_identity_fields($context, false); + + if ($CFG->branch >= 311) { + $userfields = \core_user\fields::get_identity_fields($context, false); + } + $options = [ 'ajax' => 'enrol_manual/form-potential-user-selector', 'multiple' => true, diff --git a/version.php b/version.php index d34c7d9..1ea7dfe 100755 --- a/version.php +++ b/version.php @@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2024042800; +$plugin->version = 2024042801; $plugin->requires = 2013111800; // Moodle 3.9. $plugin->release = '2.2.1'; $plugin->component = "enrol_invitation";