michael-milette / moodle-local_mailtest

Moodle MailTest allows administrators to test Moodle's email system. A trace of the SMTP dialogue will be displayed if the email message cannot be sent for any reason. For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/local_mailtest
GNU General Public License v3.0
19 stars 12 forks source link

Uses deprecated textlib static method #5

Closed mudrd8mz closed 9 years ago

mudrd8mz commented 9 years ago

According to lib/upgrade.txt, all the textlib::* calls should be replaced with core_text::* since Moodle 2.6. If you want to maintain a single branch of the plugin, you may wish to use something like this in your index.php (not tested):

if ($CFG->branch >= 26) {
    $toemail = core_text::strtolower($data->recipient);
} else {
    $toemail = textlib::strtolower($data->recipient);
}

Because of the textlib, the plugin fails to work in recent Moodle 2.9 (I am aware that it is not declared as a supported version yet. I tried it out just for curiosity):

Fatal error: Class 'textlib' not found in local/mailtest/index.php on line 90
michael-milette commented 9 years ago

Thanks David. I really appreciate your feedback. I had not tested it with Moodle versions after 2.7. Good to know. Will be fixed in the next release, probably within the next 24 hours.

michael-milette commented 9 years ago

Fixed. I've now also tested the plugin with Moodle up to 3.0 RC1 and it works great with your suggested fix. Thanks again for the feedback David!

Best regards,

Michael