Merge branch 'MDL-70067-310_theme_classic' of https://github.com/alexmorrisnz/moodle...
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 12 Nov 2020 02:27:27 +0000 (10:27 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 12 Nov 2020 02:27:27 +0000 (10:27 +0800)
644 files changed:
admin/tool/analytics/version.php
admin/tool/availabilityconditions/version.php
admin/tool/behat/version.php
admin/tool/capability/version.php
admin/tool/cohortroles/db/upgrade.php
admin/tool/cohortroles/version.php
admin/tool/customlang/db/upgrade.php
admin/tool/customlang/version.php
admin/tool/dataprivacy/db/upgrade.php
admin/tool/dataprivacy/version.php
admin/tool/dbtransfer/version.php
admin/tool/filetypes/version.php
admin/tool/generator/version.php
admin/tool/health/version.php
admin/tool/httpsreplace/version.php
admin/tool/innodb/version.php
admin/tool/installaddon/version.php
admin/tool/langimport/version.php
admin/tool/licensemanager/version.php
admin/tool/log/db/upgrade.php
admin/tool/log/store/database/db/upgrade.php
admin/tool/log/store/database/version.php
admin/tool/log/store/legacy/version.php
admin/tool/log/store/standard/db/upgrade.php
admin/tool/log/store/standard/version.php
admin/tool/log/version.php
admin/tool/lp/version.php
admin/tool/lpimportcsv/version.php
admin/tool/lpmigrate/version.php
admin/tool/messageinbound/version.php
admin/tool/mobile/db/upgrade.php
admin/tool/mobile/version.php
admin/tool/monitor/db/upgrade.php
admin/tool/monitor/version.php
admin/tool/moodlenet/db/upgrade.php
admin/tool/moodlenet/version.php
admin/tool/multilangupgrade/version.php
admin/tool/oauth2/version.php
admin/tool/phpunit/version.php
admin/tool/policy/db/upgrade.php
admin/tool/policy/version.php
admin/tool/profiling/version.php
admin/tool/recyclebin/version.php
admin/tool/replace/version.php
admin/tool/spamcleaner/version.php
admin/tool/task/version.php
admin/tool/templatelibrary/version.php
admin/tool/unsuproles/version.php
admin/tool/uploadcourse/classes/course.php
admin/tool/uploadcourse/tests/behat/enrolments.feature [new file with mode: 0644]
admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv [new file with mode: 0644]
admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv [new file with mode: 0644]
admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv [new file with mode: 0644]
admin/tool/uploadcourse/version.php
admin/tool/uploaduser/classes/process.php
admin/tool/uploaduser/version.php
admin/tool/usertours/db/upgrade.php
admin/tool/usertours/version.php
admin/tool/xmldb/actions/XMLDBCheckAction.class.php
admin/tool/xmldb/version.php
auth/cas/db/upgrade.php
auth/cas/version.php
auth/db/auth.php
auth/db/db/upgrade.php
auth/db/tests/db_test.php
auth/db/version.php
auth/email/db/upgrade.php
auth/email/version.php
auth/ldap/db/upgrade.php
auth/ldap/version.php
auth/lti/version.php
auth/manual/db/upgrade.php
auth/manual/version.php
auth/mnet/db/upgrade.php
auth/mnet/version.php
auth/nologin/version.php
auth/none/db/upgrade.php
auth/none/version.php
auth/oauth2/db/upgrade.php
auth/oauth2/version.php
auth/shibboleth/db/upgrade.php
auth/shibboleth/version.php
auth/webservice/version.php
availability/condition/completion/version.php
availability/condition/date/version.php
availability/condition/grade/version.php
availability/condition/group/version.php
availability/condition/grouping/version.php
availability/condition/profile/version.php
backup/backup.class.php
backup/controller/restore_controller.class.php
backup/moodle2/restore_stepslib.php
badges/backpack-add.php
badges/classes/external/assertion_exporter.php
badges/classes/external/badgeclass_exporter.php
badges/renderer.php
badges/tests/badgeslib_test.php
blocks/activity_modules/version.php
blocks/activity_results/version.php
blocks/admin_bookmarks/version.php
blocks/badges/db/upgrade.php
blocks/badges/version.php
blocks/blog_menu/version.php
blocks/blog_recent/version.php
blocks/blog_tags/version.php
blocks/calendar_month/db/upgrade.php
blocks/calendar_month/version.php
blocks/calendar_upcoming/db/upgrade.php
blocks/calendar_upcoming/version.php
blocks/classes/external.php
blocks/comments/version.php
blocks/completionstatus/db/upgrade.php
blocks/completionstatus/version.php
blocks/course_list/version.php
blocks/course_summary/db/upgrade.php
blocks/course_summary/version.php
blocks/feedback/version.php
blocks/globalsearch/version.php
blocks/glossary_random/version.php
blocks/html/db/upgrade.php
blocks/html/version.php
blocks/login/version.php
blocks/lp/version.php
blocks/mentees/version.php
blocks/mnet_hosts/version.php
blocks/myoverview/db/upgrade.php
blocks/myoverview/version.php
blocks/myprofile/version.php
blocks/navigation/db/upgrade.php
blocks/navigation/version.php
blocks/news_items/version.php
blocks/online_users/version.php
blocks/private_files/version.php
blocks/quiz_results/db/upgrade.php
blocks/quiz_results/version.php
blocks/recent_activity/db/upgrade.php
blocks/recent_activity/version.php
blocks/recentlyaccessedcourses/version.php
blocks/recentlyaccesseditems/db/upgrade.php
blocks/recentlyaccesseditems/version.php
blocks/rss_client/db/upgrade.php
blocks/rss_client/version.php
blocks/search_forums/version.php
blocks/section_links/db/upgrade.php
blocks/section_links/version.php
blocks/selfcompletion/db/upgrade.php
blocks/selfcompletion/version.php
blocks/settings/db/upgrade.php
blocks/settings/version.php
blocks/site_main_menu/version.php
blocks/social_activities/version.php
blocks/starredcourses/version.php
blocks/tag_flickr/version.php
blocks/tag_youtube/block_tag_youtube.php
blocks/tag_youtube/db/upgrade.php [new file with mode: 0644]
blocks/tag_youtube/edit_form.php
blocks/tag_youtube/lang/en/block_tag_youtube.php
blocks/tag_youtube/tests/behat/configure_tag_youtube_block.feature [new file with mode: 0644]
blocks/tag_youtube/upgrade.txt
blocks/tag_youtube/version.php
blocks/tags/version.php
blocks/timeline/version.php
cache/classes/config.php
cache/locallib.php
cache/locks/file/version.php
cache/stores/apcu/version.php
cache/stores/file/version.php
cache/stores/memcached/version.php
cache/stores/mongodb/version.php
cache/stores/redis/lib.php
cache/stores/redis/version.php
cache/stores/session/version.php
cache/stores/static/version.php
calendar/type/gregorian/version.php
contentbank/contenttype/h5p/version.php
contentbank/templates/bankcontent.mustache
contentbank/templates/renamecontent.mustache
course/amd/build/downloadcontent.min.js
course/amd/build/downloadcontent.min.js.map
course/amd/src/downloadcontent.js
course/classes/output/content_export_link.php
course/format/singleactivity/version.php
course/format/social/version.php
course/format/topics/db/upgrade.php
course/format/topics/version.php
course/format/weeks/db/upgrade.php
course/format/weeks/version.php
course/lib.php
course/tests/courselib_test.php
customfield/field/checkbox/version.php
customfield/field/date/version.php
customfield/field/select/version.php
customfield/field/text/version.php
customfield/field/textarea/version.php
dataformat/csv/version.php
dataformat/excel/version.php
dataformat/html/version.php
dataformat/json/version.php
dataformat/ods/version.php
dataformat/pdf/classes/writer.php
dataformat/pdf/version.php
enrol/category/version.php
enrol/cohort/version.php
enrol/database/db/upgrade.php
enrol/database/version.php
enrol/fee/version.php
enrol/flatfile/db/upgrade.php
enrol/flatfile/version.php
enrol/guest/db/upgrade.php
enrol/guest/version.php
enrol/imsenterprise/db/upgrade.php
enrol/imsenterprise/version.php
enrol/ldap/version.php
enrol/lti/db/upgrade.php
enrol/lti/version.php
enrol/manual/db/upgrade.php
enrol/manual/version.php
enrol/meta/version.php
enrol/mnet/db/upgrade.php
enrol/mnet/version.php
enrol/paypal/db/upgrade.php
enrol/paypal/version.php
enrol/self/db/upgrade.php
enrol/self/version.php
enrol/tests/enrollib_test.php
files/converter/googledrive/version.php
files/converter/unoconv/version.php
filter/activitynames/version.php
filter/algebra/version.php
filter/censor/version.php
filter/data/version.php
filter/displayh5p/db/upgrade.php
filter/displayh5p/version.php
filter/emailprotect/version.php
filter/emoticon/version.php
filter/glossary/version.php
filter/mathjaxloader/db/upgrade.php
filter/mathjaxloader/version.php
filter/mediaplugin/db/upgrade.php
filter/mediaplugin/version.php
filter/multilang/version.php
filter/tex/db/upgrade.php
filter/tex/version.php
filter/tidy/version.php
filter/urltolink/version.php
grade/export/ods/version.php
grade/export/txt/version.php
grade/export/xls/version.php
grade/export/xml/version.php
grade/grading/form/guide/db/upgrade.php
grade/grading/form/guide/version.php
grade/grading/form/rubric/db/upgrade.php
grade/grading/form/rubric/version.php
grade/import/csv/version.php
grade/import/direct/version.php
grade/import/xml/version.php
grade/report/grader/version.php
grade/report/history/db/upgrade.php
grade/report/history/version.php
grade/report/outcomes/version.php
grade/report/overview/db/upgrade.php
grade/report/overview/version.php
grade/report/singleview/version.php
grade/report/user/db/upgrade.php
grade/report/user/version.php
h5p/h5plib/v124/version.php
lib/amd/build/custom_interaction_events.min.js
lib/amd/build/custom_interaction_events.min.js.map
lib/amd/build/form-autocomplete.min.js
lib/amd/build/form-autocomplete.min.js.map
lib/amd/build/icon_system_fontawesome.min.js
lib/amd/build/icon_system_fontawesome.min.js.map
lib/amd/build/tree.min.js
lib/amd/build/tree.min.js.map
lib/amd/build/user_date.min.js
lib/amd/build/user_date.min.js.map
lib/amd/src/custom_interaction_events.js
lib/amd/src/form-autocomplete.js
lib/amd/src/icon_system_fontawesome.js
lib/amd/src/tree.js
lib/amd/src/user_date.js
lib/antivirus/clamav/db/upgrade.php
lib/antivirus/clamav/version.php
lib/badgeslib.php
lib/clilib.php
lib/db/upgrade.php
lib/dml/mysqli_native_moodle_database.php
lib/dml/tests/dml_test.php
lib/editor/atto/db/upgrade.php
lib/editor/atto/plugins/accessibilitychecker/version.php
lib/editor/atto/plugins/accessibilityhelper/version.php
lib/editor/atto/plugins/align/version.php
lib/editor/atto/plugins/backcolor/version.php
lib/editor/atto/plugins/bold/version.php
lib/editor/atto/plugins/charmap/version.php
lib/editor/atto/plugins/clear/version.php
lib/editor/atto/plugins/collapse/version.php
lib/editor/atto/plugins/emojipicker/version.php
lib/editor/atto/plugins/emoticon/version.php
lib/editor/atto/plugins/equation/db/upgrade.php
lib/editor/atto/plugins/equation/version.php
lib/editor/atto/plugins/fontcolor/version.php
lib/editor/atto/plugins/h5p/version.php
lib/editor/atto/plugins/html/version.php
lib/editor/atto/plugins/image/version.php
lib/editor/atto/plugins/indent/version.php
lib/editor/atto/plugins/italic/version.php
lib/editor/atto/plugins/link/version.php
lib/editor/atto/plugins/managefiles/version.php
lib/editor/atto/plugins/media/version.php
lib/editor/atto/plugins/noautolink/version.php
lib/editor/atto/plugins/orderedlist/version.php
lib/editor/atto/plugins/recordrtc/version.php
lib/editor/atto/plugins/rtl/version.php
lib/editor/atto/plugins/strike/version.php
lib/editor/atto/plugins/subscript/version.php
lib/editor/atto/plugins/superscript/version.php
lib/editor/atto/plugins/table/version.php
lib/editor/atto/plugins/title/version.php
lib/editor/atto/plugins/underline/version.php
lib/editor/atto/plugins/undo/version.php
lib/editor/atto/plugins/unorderedlist/version.php
lib/editor/atto/version.php
lib/editor/textarea/version.php
lib/editor/tinymce/db/upgrade.php
lib/editor/tinymce/plugins/ctrlhelp/version.php
lib/editor/tinymce/plugins/managefiles/version.php
lib/editor/tinymce/plugins/moodleemoticon/version.php
lib/editor/tinymce/plugins/moodleimage/version.php
lib/editor/tinymce/plugins/moodlemedia/version.php
lib/editor/tinymce/plugins/moodlenolink/version.php
lib/editor/tinymce/plugins/pdw/version.php
lib/editor/tinymce/plugins/spellchecker/db/upgrade.php
lib/editor/tinymce/plugins/spellchecker/version.php
lib/editor/tinymce/plugins/wrap/version.php
lib/editor/tinymce/version.php
lib/enrollib.php
lib/mlbackend/php/version.php
lib/mlbackend/python/version.php
lib/moodlelib.php
lib/setuplib.php
lib/tests/moodlelib_test.php
media/player/html5audio/version.php
media/player/html5video/version.php
media/player/swf/version.php
media/player/videojs/version.php
media/player/vimeo/version.php
media/player/youtube/version.php
message/output/airnotifier/classes/manager.php
message/output/airnotifier/version.php
message/output/email/db/upgrade.php
message/output/email/version.php
message/output/jabber/db/upgrade.php
message/output/jabber/version.php
message/output/popup/db/upgrade.php
message/output/popup/version.php
mnet/service/enrol/version.php
mod/assign/db/upgrade.php
mod/assign/feedback/comments/db/upgrade.php
mod/assign/feedback/comments/version.php
mod/assign/feedback/editpdf/db/upgrade.php
mod/assign/feedback/editpdf/lib.php
mod/assign/feedback/editpdf/version.php
mod/assign/feedback/file/db/upgrade.php
mod/assign/feedback/file/version.php
mod/assign/feedback/offline/version.php
mod/assign/submission/comments/db/upgrade.php
mod/assign/submission/comments/version.php
mod/assign/submission/file/db/upgrade.php
mod/assign/submission/file/version.php
mod/assign/submission/onlinetext/db/upgrade.php
mod/assign/submission/onlinetext/version.php
mod/assign/version.php
mod/assignment/db/upgrade.php
mod/assignment/type/offline/version.php
mod/assignment/type/online/version.php
mod/assignment/type/upload/version.php
mod/assignment/type/uploadsingle/version.php
mod/assignment/version.php
mod/book/db/upgrade.php
mod/book/tool/exportimscp/version.php
mod/book/tool/importhtml/version.php
mod/book/tool/print/version.php
mod/book/version.php
mod/chat/db/upgrade.php
mod/chat/version.php
mod/choice/db/upgrade.php
mod/choice/version.php
mod/data/classes/external.php
mod/data/db/upgrade.php
mod/data/field/checkbox/version.php
mod/data/field/date/version.php
mod/data/field/file/version.php
mod/data/field/latlong/version.php
mod/data/field/menu/version.php
mod/data/field/multimenu/version.php
mod/data/field/number/version.php
mod/data/field/picture/version.php
mod/data/field/radiobutton/version.php
mod/data/field/text/version.php
mod/data/field/textarea/field.class.php
mod/data/field/textarea/version.php
mod/data/field/url/version.php
mod/data/preset/imagegallery/version.php
mod/data/tests/externallib_test.php
mod/data/version.php
mod/feedback/db/upgrade.php
mod/feedback/version.php
mod/folder/db/upgrade.php
mod/folder/version.php
mod/forum/db/upgrade.php
mod/forum/report/summary/version.php
mod/forum/version.php
mod/glossary/db/upgrade.php
mod/glossary/version.php
mod/h5pactivity/db/upgrade.php
mod/h5pactivity/version.php
mod/imscp/db/upgrade.php
mod/imscp/version.php
mod/label/db/upgrade.php
mod/label/version.php
mod/lesson/db/upgrade.php
mod/lesson/version.php
mod/lti/db/upgrade.php
mod/lti/openid-configuration.php
mod/lti/service/basicoutcomes/version.php
mod/lti/service/gradebookservices/db/upgrade.php
mod/lti/service/gradebookservices/version.php
mod/lti/service/memberships/version.php
mod/lti/service/profile/version.php
mod/lti/service/toolproxy/version.php
mod/lti/service/toolsettings/version.php
mod/lti/version.php
mod/page/db/upgrade.php
mod/page/version.php
mod/quiz/accessrule/delaybetweenattempts/version.php
mod/quiz/accessrule/ipaddress/version.php
mod/quiz/accessrule/numattempts/version.php
mod/quiz/accessrule/offlineattempts/version.php
mod/quiz/accessrule/openclosedate/version.php
mod/quiz/accessrule/password/version.php
mod/quiz/accessrule/seb/db/upgrade.php
mod/quiz/accessrule/seb/version.php
mod/quiz/accessrule/securewindow/version.php
mod/quiz/accessrule/timelimit/version.php
mod/quiz/classes/external.php
mod/quiz/db/upgrade.php
mod/quiz/mod_form.php
mod/quiz/report/grading/version.php
mod/quiz/report/overview/db/upgrade.php
mod/quiz/report/overview/version.php
mod/quiz/report/responses/version.php
mod/quiz/report/statistics/db/upgrade.php
mod/quiz/report/statistics/version.php
mod/quiz/tests/behat/editing_add_from_question_bank.feature
mod/quiz/tests/external_test.php
mod/quiz/upgrade.txt
mod/quiz/version.php
mod/resource/db/upgrade.php
mod/resource/version.php
mod/scorm/db/upgrade.php
mod/scorm/report/basic/version.php
mod/scorm/report/graphs/version.php
mod/scorm/report/interactions/version.php
mod/scorm/report/objectives/version.php
mod/scorm/version.php
mod/survey/db/upgrade.php
mod/survey/version.php
mod/url/db/upgrade.php
mod/url/version.php
mod/wiki/db/upgrade.php
mod/wiki/version.php
mod/workshop/allocation/manual/version.php
mod/workshop/allocation/random/version.php
mod/workshop/allocation/scheduled/version.php
mod/workshop/db/upgrade.php
mod/workshop/eval/best/version.php
mod/workshop/form/accumulative/db/upgrade.php
mod/workshop/form/accumulative/version.php
mod/workshop/form/comments/db/upgrade.php
mod/workshop/form/comments/version.php
mod/workshop/form/numerrors/db/upgrade.php
mod/workshop/form/numerrors/version.php
mod/workshop/form/rubric/db/upgrade.php
mod/workshop/form/rubric/version.php
mod/workshop/version.php
payment/gateway/paypal/version.php
portfolio/boxnet/db/upgrade.php
portfolio/boxnet/version.php
portfolio/download/version.php
portfolio/flickr/version.php
portfolio/googledocs/db/upgrade.php
portfolio/googledocs/version.php
portfolio/mahara/version.php
portfolio/picasa/db/upgrade.php
portfolio/picasa/version.php
question/behaviour/adaptive/version.php
question/behaviour/adaptivenopenalty/version.php
question/behaviour/deferredcbm/version.php
question/behaviour/deferredfeedback/version.php
question/behaviour/immediatecbm/version.php
question/behaviour/immediatefeedback/version.php
question/behaviour/informationitem/version.php
question/behaviour/interactive/version.php
question/behaviour/interactivecountback/version.php
question/behaviour/manualgraded/db/upgrade.php
question/behaviour/manualgraded/version.php
question/behaviour/missing/version.php
question/classes/bank/view.php
question/format/aiken/version.php
question/format/blackboard_six/version.php
question/format/examview/version.php
question/format/gift/version.php
question/format/missingword/version.php
question/format/multianswer/version.php
question/format/webct/version.php
question/format/xhtml/version.php
question/format/xml/version.php
question/type/calculated/db/upgrade.php
question/type/calculated/tests/question_test.php
question/type/calculated/version.php
question/type/calculatedmulti/version.php
question/type/calculatedsimple/version.php
question/type/ddimageortext/amd/build/form.min.js
question/type/ddimageortext/amd/build/form.min.js.map
question/type/ddimageortext/amd/build/question.min.js
question/type/ddimageortext/amd/build/question.min.js.map
question/type/ddimageortext/amd/src/form.js
question/type/ddimageortext/amd/src/question.js
question/type/ddimageortext/version.php
question/type/ddmarker/amd/build/form.min.js
question/type/ddmarker/amd/build/form.min.js.map
question/type/ddmarker/amd/src/form.js
question/type/ddmarker/db/upgrade.php
question/type/ddmarker/version.php
question/type/ddwtos/version.php
question/type/description/version.php
question/type/edit_question_form.php
question/type/essay/db/upgrade.php
question/type/essay/question.php
question/type/essay/tests/question_test.php
question/type/essay/version.php
question/type/gapselect/questionbase.php
question/type/gapselect/tests/question_test.php
question/type/gapselect/version.php
question/type/match/db/upgrade.php
question/type/match/question.php
question/type/match/tests/question_test.php
question/type/match/version.php
question/type/missingtype/version.php
question/type/multianswer/db/upgrade.php
question/type/multianswer/question.php
question/type/multianswer/tests/question_test.php
question/type/multianswer/version.php
question/type/multichoice/db/upgrade.php
question/type/multichoice/question.php
question/type/multichoice/tests/question_multi_test.php
question/type/multichoice/version.php
question/type/numerical/db/upgrade.php
question/type/numerical/question.php
question/type/numerical/questiontype.php
question/type/numerical/tests/question_test.php
question/type/numerical/version.php
question/type/questionbase.php
question/type/random/db/upgrade.php
question/type/random/version.php
question/type/randomsamatch/db/upgrade.php
question/type/randomsamatch/version.php
question/type/shortanswer/db/upgrade.php
question/type/shortanswer/question.php
question/type/shortanswer/tests/question_test.php
question/type/shortanswer/version.php
question/type/truefalse/question.php
question/type/truefalse/tests/question_test.php
question/type/truefalse/version.php
report/backups/version.php
report/competency/version.php
report/completion/version.php
report/configlog/version.php
report/courseoverview/version.php
report/eventlist/version.php
report/infectedfiles/version.php
report/insights/version.php
report/log/version.php
report/loglive/version.php
report/outline/version.php
report/participation/version.php
report/performance/version.php
report/progress/version.php
report/questioninstances/version.php
report/security/version.php
report/stats/version.php
report/status/version.php
report/usersessions/version.php
repository/areafiles/version.php
repository/boxnet/db/upgrade.php
repository/boxnet/version.php
repository/contentbank/version.php
repository/coursefiles/version.php
repository/dropbox/db/upgrade.php
repository/dropbox/version.php
repository/equella/version.php
repository/filesystem/version.php
repository/flickr/db/upgrade.php
repository/flickr/version.php
repository/flickr_public/version.php
repository/googledocs/db/upgrade.php
repository/googledocs/version.php
repository/local/version.php
repository/merlot/version.php
repository/nextcloud/version.php
repository/onedrive/db/upgrade.php
repository/onedrive/version.php
repository/picasa/db/upgrade.php
repository/picasa/version.php
repository/recent/version.php
repository/s3/version.php
repository/skydrive/version.php
repository/upload/version.php
repository/url/version.php
repository/user/version.php
repository/webdav/version.php
repository/wikimedia/version.php
repository/youtube/version.php
search/engine/simpledb/version.php
search/engine/solr/version.php
tag/classes/tag.php
tag/tests/taglib_test.php
theme/boost/scss/moodle/bootstrap-rtl.scss
theme/boost/scss/moodle/modules.scss
theme/boost/style/moodle.css
theme/boost/version.php
theme/classic/style/moodle.css
theme/classic/version.php
user/action_redir.php
user/profile/field/checkbox/version.php
user/profile/field/datetime/version.php
user/profile/field/menu/version.php
user/profile/field/text/version.php
user/profile/field/textarea/version.php
version.php
webservice/rest/version.php
webservice/soap/version.php
webservice/xmlrpc/version.php

index d4c2fba..7cd2216 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_analytics'; // Full name of the plugin (used for diagnostics).
index e1c70f5..92dfc6c 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'tool_availabilityconditions';
index daee263..e0de58c 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;   // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;   // Requires this Moodle version
+$plugin->version   = 2020110900;   // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;   // Requires this Moodle version
 $plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
index 7babee7..d05f913 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics).
index 7984d25..06133ab 100644 (file)
@@ -44,5 +44,8 @@ function xmldb_tool_cohortroles_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 78a1b83..f2c2b46 100644 (file)
@@ -25,8 +25,8 @@
 defined('MOODLE_INTERNAL') || die();
 
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
 
 $plugin->dependencies = array(
index 42d0133..8d00b39 100644 (file)
@@ -44,5 +44,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 45eb880..ec8efe1 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020101300;
-$plugin->requires  = 2020060900;
+$plugin->version   = 2020110900;
+$plugin->requires  = 2020110300;
 $plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
index 30a9881..6487375 100644 (file)
@@ -356,5 +356,8 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2020061501, 'tool', 'dataprivacy');
     }
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 1df48bc..5221452 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die;
 
-$plugin->version   = 2020061501;
-$plugin->requires  = 2020060900;
+$plugin->version   = 2020110900;
+$plugin->requires  = 2020110300;
 $plugin->component = 'tool_dataprivacy';
index d89490a..65dd80b 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_dbtransfer'; // Full name of the plugin (used for diagnostics).
index 51da479..514ea07 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'tool_filetypes';
index 5bd0684..2e998d0 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'tool_generator';
index 841691d..96cfdc4 100644 (file)
@@ -25,8 +25,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_health'; // Full name of the plugin (used for diagnostics)
 
 $plugin->maturity  = MATURITY_ALPHA; // this version's maturity level
index 6fc9cf8..7507416 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_httpsreplace'; // Full name of the plugin (used for diagnostics).
index 734df35..c530c92 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_innodb'; // Full name of the plugin (used for diagnostics)
index d2530c0..74cb7ab 100644 (file)
@@ -24,6 +24,6 @@
 defined('MOODLE_INTERNAL') || die();
 
 $plugin->component  = 'tool_installaddon';
-$plugin->version    = 2020061500;
-$plugin->requires   = 2020060900;
+$plugin->version    = 2020110900;
+$plugin->requires   = 2020110300;
 $plugin->maturity   = MATURITY_STABLE;
index dee1b46..db92892 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_langimport'; // Full name of the plugin (used for diagnostics)
index a05ba8b..4c26a35 100644 (file)
@@ -24,8 +24,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;
-$plugin->requires  = 2020060900;         // Requires this Moodle version.
+$plugin->version   = 2020110900;
+$plugin->requires  = 2020110300;         // Requires this Moodle version.
 $plugin->component = 'tool_licensemanager';
 
 $plugin->maturity = MATURITY_STABLE;
index 6fffa79..e8469dc 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_tool_log_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 1b9aef2..525352f 100644 (file)
@@ -49,5 +49,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 70d1a2d..5fb390c 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2020060900; // Requires this Moodle version.
+$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2020110300; // Requires this Moodle version.
 $plugin->component = 'logstore_database'; // Full name of the plugin (used for diagnostics).
index dbb4906..1088470 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2020060900; // Requires this Moodle version.
+$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2020110300; // Requires this Moodle version.
 $plugin->component = 'logstore_legacy'; // Full name of the plugin (used for diagnostics).
index 25ec6eb..db7076c 100644 (file)
@@ -49,5 +49,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index beb8247..cfe185a 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2020060900; // Requires this Moodle version.
+$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2020110300; // Requires this Moodle version.
 $plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).
index 101e890..669705f 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2020060900; // Requires this Moodle version.
+$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_log'; // Full name of the plugin (used for diagnostics).
index 855ab25..185bf78 100644 (file)
@@ -25,6 +25,6 @@
 defined('MOODLE_INTERNAL') || die();
 
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_lp'; // Full name of the plugin (used for diagnostics).
index 032cdb5..ad4d29b 100644 (file)
@@ -25,8 +25,8 @@
 defined('MOODLE_INTERNAL') || die();
 
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_lpimportcsv'; // Full name of the plugin (used for diagnostics).
-$plugin->dependencies = array('tool_lp' => 2020060900);
+$plugin->dependencies = array('tool_lp' => 2020110300);
 
index 9e15806..6d8f6e1 100644 (file)
@@ -24,8 +24,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_lpmigrate'; // Full name of the plugin (used for diagnostics).
 $plugin->dependencies = array(
     'tool_lp' => ANY_VERSION
index fa17bc3..c00bad4 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;
-$plugin->requires  = 2020060900;
+$plugin->version   = 2020110900;
+$plugin->requires  = 2020110300;
 $plugin->component = 'tool_messageinbound';
index ace131e..f6727be 100644 (file)
@@ -51,5 +51,8 @@ function xmldb_tool_mobile_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8c4a6f8..ba9504e 100644 (file)
@@ -23,9 +23,9 @@
  */
 
 defined('MOODLE_INTERNAL') || die();
-$plugin->version   = 2020061501; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics).
 $plugin->dependencies = array(
-    'webservice_rest' => 2020060900
+    'webservice_rest' => 2020110300
 );
index d8c4fd2..a71bb4d 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c80a809..2635181 100644 (file)
@@ -26,6 +26,6 @@
 
 defined('MOODLE_INTERNAL') || die;
 
-$plugin->version   = 2020061500;     // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900;     // Requires this Moodle version.
+$plugin->version   = 2020110900;     // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300;     // Requires this Moodle version.
 $plugin->component = 'tool_monitor'; // Full name of the plugin (used for diagnostics).
index 20d5118..ac5a4c9 100644 (file)
@@ -123,5 +123,8 @@ function xmldb_tool_moodlenet_upgrade(int $oldversion) {
         upgrade_plugin_savepoint(true, 2020090700, 'tool', 'moodlenet');
     }
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 00d3399..9b086d4 100644 (file)
@@ -25,6 +25,6 @@
 defined('MOODLE_INTERNAL') || die();
 
 $plugin->component  = 'tool_moodlenet';
-$plugin->version    = 2020090700;
-$plugin->requires   = 2020060900;
+$plugin->version    = 2020110900;
+$plugin->requires   = 2020110300;
 $plugin->maturity   = MATURITY_ALPHA;
index fdc6025..b2d47dd 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_multilangupgrade'; // Full name of the plugin (used for diagnostics)
 
index 8c9f9e8..cce204c 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_oauth2'; // Full name of the plugin (used for diagnostics).
 
index 4144fe5..77653cb 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_phpunit'; // Full name of the plugin (used for diagnostics)
 
index 4da195d..a6cb527 100644 (file)
@@ -72,5 +72,8 @@ function xmldb_tool_policy_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 51d51fd..0cd0214 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;         // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900;         // Requires this Moodle version.
+$plugin->version   = 2020110900;         // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300;         // Requires this Moodle version.
 $plugin->component = 'tool_policy';      // Full name of the plugin (used for diagnostics).
index 9c391dc..bbb11b5 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_profiling'; // Full name of the plugin (used for diagnostics)
index 98370c0..5178ea8 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_recyclebin'; // Full name of the plugin (used for diagnostics).
index 3621d68..c3e7768 100644 (file)
@@ -25,8 +25,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_replace'; // Full name of the plugin (used for diagnostics)
 
 $plugin->maturity  = MATURITY_ALPHA; // this version's maturity level
index 4f6daba..e17558f 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;
-$plugin->requires  = 2020060900;
+$plugin->version   = 2020110900;
+$plugin->requires  = 2020110300;
 $plugin->component = 'tool_spamcleaner'; // Full name of the plugin (used for diagnostics)
 
index 40800e0..d22720b 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061501; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_task'; // Full name of the plugin (used for diagnostics)
 
index aa6dcfb..6e29c0a 100644 (file)
@@ -21,6 +21,6 @@
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 defined('MOODLE_INTERNAL') || die();
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900; // Requires this Moodle version.
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300; // Requires this Moodle version.
 $plugin->component = 'tool_templatelibrary'; // Full name of the plugin (used for diagnostics).
index c4d9964..b814033 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_unsuproles'; // Full name of the plugin (used for diagnostics)
 
index fd7569e..4c45b1a 100644 (file)
@@ -980,55 +980,48 @@ class tool_uploadcourse_course {
             unset($method['delete']);
             unset($method['disable']);
 
-            if (!empty($instance) && $todelete) {
+            if ($todelete) {
                 // Remove the enrolment method.
-                foreach ($instances as $instance) {
-                    if ($instance->enrol == $enrolmethod) {
-                        $plugin = $enrolmentplugins[$instance->enrol];
-
-                        // Ensure user is able to delete the instance.
-                        if ($plugin->can_delete_instance($instance)) {
-                            $plugin->delete_instance($instance);
-                        } else {
-                            $this->error('errorcannotdeleteenrolment',
-                                new lang_string('errorcannotdeleteenrolment', 'tool_uploadcourse',
-                                    $plugin->get_instance_name($instance)));
-                        }
+                if ($instance) {
+                    $plugin = $enrolmentplugins[$instance->enrol];
 
-                        break;
-                    }
-                }
-            } else if (!empty($instance) && $todisable) {
-                // Disable the enrolment.
-                foreach ($instances as $instance) {
-                    if ($instance->enrol == $enrolmethod) {
-                        $plugin = $enrolmentplugins[$instance->enrol];
-
-                        // Ensure user is able to toggle instance status.
-                        if ($plugin->can_hide_show_instance($instance)) {
-                            $plugin->update_status($instance, ENROL_INSTANCE_DISABLED);
-                        } else {
-                            $this->error('errorcannotdisableenrolment',
-                                new lang_string('errorcannotdisableenrolment', 'tool_uploadcourse',
-                                    $plugin->get_instance_name($instance)));
-                        }
-
-                        break;
+                    // Ensure user is able to delete the instance.
+                    if ($plugin->can_delete_instance($instance)) {
+                        $plugin->delete_instance($instance);
+                    } else {
+                        $this->error('errorcannotdeleteenrolment',
+                            new lang_string('errorcannotdeleteenrolment', 'tool_uploadcourse',
+                                $plugin->get_instance_name($instance)));
                     }
                 }
             } else {
                 // Create/update enrolment.
                 $plugin = $enrolmentplugins[$enrolmethod];
 
-                // Ensure user is able to create/update instance.
+                $status = ($todisable) ? ENROL_INSTANCE_DISABLED : ENROL_INSTANCE_ENABLED;
+
+                // Create a new instance if necessary.
                 if (empty($instance) && $plugin->can_add_instance($course->id)) {
-                    $instance = new stdClass();
-                    $instance->id = $plugin->add_default_instance($course);
+                    $instanceid = $plugin->add_default_instance($course);
+                    $instance = $DB->get_record('enrol', ['id' => $instanceid]);
                     $instance->roleid = $plugin->get_config('roleid');
-                    $instance->status = ENROL_INSTANCE_ENABLED;
-                } else if (!empty($instance) && $plugin->can_edit_instance($instance)) {
-                    $plugin->update_status($instance, ENROL_INSTANCE_ENABLED);
-                } else {
+                    // On creation the user can decide the status.
+                    $plugin->update_status($instance, $status);
+                }
+
+                // Check if the we need to update the instance status.
+                if ($instance && $status != $instance->status) {
+                    if ($plugin->can_hide_show_instance($instance)) {
+                        $plugin->update_status($instance, $status);
+                    } else {
+                        $this->error('errorcannotdisableenrolment',
+                            new lang_string('errorcannotdisableenrolment', 'tool_uploadcourse',
+                                $plugin->get_instance_name($instance)));
+                        break;
+                    }
+                }
+
+                if (empty($instance) || !$plugin->can_edit_instance($instance)) {
                     $this->error('errorcannotcreateorupdateenrolment',
                         new lang_string('errorcannotcreateorupdateenrolment', 'tool_uploadcourse',
                             $plugin->get_instance_name($instance)));
diff --git a/admin/tool/uploadcourse/tests/behat/enrolments.feature b/admin/tool/uploadcourse/tests/behat/enrolments.feature
new file mode 100644 (file)
index 0000000..c8ee54d
--- /dev/null
@@ -0,0 +1,114 @@
+@tool @tool_uploadcourse @_file_upload
+Feature: An admin can update courses enrolments using a CSV file
+  In order to update courses enrolments using a CSV file
+  As an admin
+  I need to be able to upload a CSV file with enrolment methods for the courses
+
+  Background:
+    Given the following "courses" exist:
+      | fullname | shortname | category |
+      | Course 1 | C1        | 0        |
+    And I log in as "admin"
+
+  @javascript
+  Scenario: Creating enrolment method by enable it
+    Given I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And I click on "Delete" "link" in the "Guest access" "table_row"
+    And I click on "Continue" "button"
+    And I should not see "Guest access" in the "generaltable" "table"
+    And I navigate to "Courses > Upload courses" in site administration
+    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
+    And I set the field "Upload mode" to "Only update existing courses"
+    And I set the field "Update mode" to "Update with CSV data only"
+    And I set the field "Allow deletes" to "Yes"
+    And I click on "Preview" "button"
+    When I click on "Upload courses" "button"
+    Then I should see "Course updated"
+    And I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And "Disable" "icon" should exist in the "Guest access" "table_row"
+
+  @javascript
+  Scenario: Creating enrolment method by disabling it
+    Given I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And I click on "Delete" "link" in the "Guest access" "table_row"
+    And I click on "Continue" "button"
+    And I should not see "Guest access" in the "generaltable" "table"
+    And I navigate to "Courses > Upload courses" in site administration
+    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
+    And I set the field "Upload mode" to "Only update existing courses"
+    And I set the field "Update mode" to "Update with CSV data only"
+    And I set the field "Allow deletes" to "Yes"
+    And I click on "Preview" "button"
+    When I click on "Upload courses" "button"
+    Then I should see "Course updated"
+    And I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And "Enable" "icon" should exist in the "Guest access" "table_row"
+
+  @javascript
+  Scenario: Enabling enrolment method
+    Given I navigate to "Courses > Upload courses" in site administration
+    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv" file to "File" filemanager
+    And I set the field "Upload mode" to "Only update existing courses"
+    And I set the field "Update mode" to "Update with CSV data only"
+    And I set the field "Allow deletes" to "Yes"
+    And I click on "Preview" "button"
+    When I click on "Upload courses" "button"
+    Then I should see "Course updated"
+    And I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And "Disable" "icon" should exist in the "Guest access" "table_row"
+
+  @javascript
+  Scenario: Disable an enrolment method
+    Given I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And I click on "Enable" "link" in the "Guest access" "table_row"
+    And "Disable" "icon" should exist in the "Guest access" "table_row"
+    And I navigate to "Courses > Upload courses" in site administration
+    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv" file to "File" filemanager
+    And I set the field "Upload mode" to "Only update existing courses"
+    And I set the field "Update mode" to "Update with CSV data only"
+    And I set the field "Allow deletes" to "Yes"
+    And I click on "Preview" "button"
+    When I click on "Upload courses" "button"
+    Then I should see "Course updated"
+    And I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And "Enable" "icon" should exist in the "Guest access" "table_row"
+
+  @javascript
+  Scenario: Delete an enrolment method
+    Given I navigate to "Courses > Upload courses" in site administration
+    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
+    And I set the field "Upload mode" to "Only update existing courses"
+    And I set the field "Update mode" to "Update with CSV data only"
+    And I set the field "Allow deletes" to "Yes"
+    And I click on "Preview" "button"
+    When I click on "Upload courses" "button"
+    Then I should see "Course updated"
+    And I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And I should not see "Guest access" in the "generaltable" "table"
+
+  @javascript
+  Scenario: Delete an unexistent enrolment method (nothing should change)
+    Given I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And I click on "Delete" "link" in the "Guest access" "table_row"
+    And I click on "Continue" "button"
+    And I should not see "Guest access" in the "generaltable" "table"
+    And I navigate to "Courses > Upload courses" in site administration
+    And I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv" file to "File" filemanager
+    And I set the field "Upload mode" to "Only update existing courses"
+    And I set the field "Update mode" to "Update with CSV data only"
+    And I set the field "Allow deletes" to "Yes"
+    And I click on "Preview" "button"
+    When I click on "Upload courses" "button"
+    Then I should see "Course updated"
+    And I am on "Course 1" course homepage
+    And I navigate to "Users > Enrolment methods" in current page administration
+    And I should not see "Guest access" in the "generaltable" "table"
diff --git a/admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv b/admin/tool/uploadcourse/tests/fixtures/enrolment_delete.csv
new file mode 100644 (file)
index 0000000..0f219d1
--- /dev/null
@@ -0,0 +1,2 @@
+shortname,category,enrolment_1,enrolment_1_delete
+C1,1,guest,1
\ No newline at end of file
diff --git a/admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv b/admin/tool/uploadcourse/tests/fixtures/enrolment_disable.csv
new file mode 100644 (file)
index 0000000..0b3ede8
--- /dev/null
@@ -0,0 +1,2 @@
+shortname,category,enrolment_1,enrolment_1_disable
+C1,1,guest,1
\ No newline at end of file
diff --git a/admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv b/admin/tool/uploadcourse/tests/fixtures/enrolment_enable.csv
new file mode 100644 (file)
index 0000000..2bae81e
--- /dev/null
@@ -0,0 +1,2 @@
+shortname,category,enrolment_1,enrolment_1_disable
+C1,1,guest,0
\ No newline at end of file
index ea66e94..c4a3f06 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;            // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900;            // Requires this Moodle version.
+$plugin->version   = 2020110900;            // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300;            // Requires this Moodle version.
 $plugin->component = 'tool_uploadcourse';   // Full name of the plugin (used for diagnostics).
index 12c2101..5321f0e 100644 (file)
@@ -1119,10 +1119,10 @@ class process {
                     $this->upt->track('enrolments', get_string('unknowncourse', 'error', s($shortname)), 'error');
                     continue;
                 }
-                $ccache[$shortname] = $course;
-                $ccache[$shortname]->groups = null;
+                $this->ccache[$shortname] = $course;
+                $this->ccache[$shortname]->groups = null;
             }
-            $courseid      = $ccache[$shortname]->id;
+            $courseid      = $this->ccache[$shortname]->id;
             $coursecontext = \context_course::instance($courseid);
             if (!isset($this->manualcache[$courseid])) {
                 $this->manualcache[$courseid] = false;
@@ -1241,41 +1241,41 @@ class process {
                     continue;
                 }
                 // Build group cache.
-                if (is_null($ccache[$shortname]->groups)) {
-                    $ccache[$shortname]->groups = array();
+                if (is_null($this->ccache[$shortname]->groups)) {
+                    $this->ccache[$shortname]->groups = array();
                     if ($groups = groups_get_all_groups($courseid)) {
                         foreach ($groups as $gid => $group) {
-                            $ccache[$shortname]->groups[$gid] = new \stdClass();
-                            $ccache[$shortname]->groups[$gid]->id   = $gid;
-                            $ccache[$shortname]->groups[$gid]->name = $group->name;
+                            $this->ccache[$shortname]->groups[$gid] = new \stdClass();
+                            $this->ccache[$shortname]->groups[$gid]->id   = $gid;
+                            $this->ccache[$shortname]->groups[$gid]->name = $group->name;
                             if (!is_numeric($group->name)) { // Only non-numeric names are supported!!!
-                                $ccache[$shortname]->groups[$group->name] = new \stdClass();
-                                $ccache[$shortname]->groups[$group->name]->id   = $gid;
-                                $ccache[$shortname]->groups[$group->name]->name = $group->name;
+                                $this->ccache[$shortname]->groups[$group->name] = new \stdClass();
+                                $this->ccache[$shortname]->groups[$group->name]->id   = $gid;
+                                $this->ccache[$shortname]->groups[$group->name]->name = $group->name;
                             }
                         }
                     }
                 }
                 // Group exists?
                 $addgroup = $user->{'group'.$i};
-                if (!array_key_exists($addgroup, $ccache[$shortname]->groups)) {
+                if (!array_key_exists($addgroup, $this->ccache[$shortname]->groups)) {
                     // If group doesn't exist,  create it.
                     $newgroupdata = new \stdClass();
                     $newgroupdata->name = $addgroup;
-                    $newgroupdata->courseid = $ccache[$shortname]->id;
+                    $newgroupdata->courseid = $this->ccache[$shortname]->id;
                     $newgroupdata->description = '';
                     $gid = groups_create_group($newgroupdata);
                     if ($gid) {
-                        $ccache[$shortname]->groups[$addgroup] = new \stdClass();
-                        $ccache[$shortname]->groups[$addgroup]->id   = $gid;
-                        $ccache[$shortname]->groups[$addgroup]->name = $newgroupdata->name;
+                        $this->ccache[$shortname]->groups[$addgroup] = new \stdClass();
+                        $this->ccache[$shortname]->groups[$addgroup]->id   = $gid;
+                        $this->ccache[$shortname]->groups[$addgroup]->name = $newgroupdata->name;
                     } else {
                         $this->upt->track('enrolments', get_string('unknowngroup', 'error', s($addgroup)), 'error');
                         continue;
                     }
                 }
-                $gid   = $ccache[$shortname]->groups[$addgroup]->id;
-                $gname = $ccache[$shortname]->groups[$addgroup]->name;
+                $gid   = $this->ccache[$shortname]->groups[$addgroup]->id;
+                $gname = $this->ccache[$shortname]->groups[$addgroup]->name;
 
                 try {
                     if (groups_add_member($gid, $user->id)) {
index cff2376..12f8429 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_uploaduser'; // Full name of the plugin (used for diagnostics)
 
index e3c0fc9..f7ef9fc 100644 (file)
@@ -79,5 +79,8 @@ function xmldb_tool_usertours_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2020082700, 'tool', 'usertours');
     }
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d621cef..6d49584 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020082701;            // The current module version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900;            // Requires this Moodle version.
+$plugin->version   = 2020110900;            // The current module version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300;            // Requires this Moodle version.
 $plugin->component = 'tool_usertours';      // Full name of the plugin (used for diagnostics).
index 2514c61..5ffc70e 100644 (file)
@@ -149,7 +149,7 @@ abstract class XMLDBCheckAction extends XMLDBAction {
                                 continue;
                             }
                             // Fetch metadata from physical DB. All the columns info.
-                            if (!$metacolumns = $DB->get_columns($xmldb_table->getName())) {
+                            if (!$metacolumns = $DB->get_columns($xmldb_table->getName(), false)) {
                                 // / Skip table if no metacolumns is available for it
                                 continue;
                             }
index c96d978..1d0772c 100644 (file)
@@ -24,7 +24,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900; // Requires this Moodle version
+$plugin->version   = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300; // Requires this Moodle version
 $plugin->component = 'tool_xmldb'; // Full name of the plugin (used for diagnostics)
 
index 78bff15..b4e380b 100644 (file)
@@ -55,5 +55,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2020081700, 'auth', 'cas');
     }
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index e77e268..e2cf963 100644 (file)
@@ -26,8 +26,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020081700;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_cas';        // Full name of the plugin (used for diagnostics)
 
-$plugin->dependencies = array('auth_ldap' => 2020060900);
+$plugin->dependencies = array('auth_ldap' => 2020110300);
index 5c0f74f..9d3cc18 100644 (file)
@@ -460,7 +460,7 @@ class auth_plugin_db extends auth_plugin_base {
                     continue;
                 }
                 try {
-                    $id = user_create_user($user, false); // It is truly a new user.
+                    $id = user_create_user($user, false, false); // It is truly a new user.
                     $trace->output(get_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)), 1);
                 } catch (moodle_exception $e) {
                     $trace->output(get_string('auth_dbinsertusererror', 'auth_db', $user->username), 1);
@@ -479,6 +479,8 @@ class auth_plugin_db extends auth_plugin_base {
 
                 // Make sure user context is present.
                 context_user::instance($id);
+
+                \core\event\user_created::create_from_userid($id)->trigger();
             }
             unset($add_users);
         }
index 3fdd848..33fc225 100644 (file)
@@ -47,5 +47,8 @@ function xmldb_auth_db_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index b17a7c0..1de432c 100644 (file)
@@ -119,6 +119,7 @@ class auth_db_testcase extends advanced_testcase {
         $table->add_field('email', XMLDB_TYPE_CHAR, '255', null, null, null);
         $table->add_field('firstname', XMLDB_TYPE_CHAR, '255', null, null, null);
         $table->add_field('lastname', XMLDB_TYPE_CHAR, '255', null, null, null);
+        $table->add_field('animal', XMLDB_TYPE_CHAR, '255', null, null, null);
         $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
         if ($dbman->table_exists($table)) {
             $dbman->drop_table($table);
@@ -137,6 +138,15 @@ class auth_db_testcase extends advanced_testcase {
         set_config('field_updateremote_email', '0', 'auth_db');
         set_config('field_lock_email', 'unlocked', 'auth_db');
 
+        // Create a user profile field and add mapping to it.
+        $DB->insert_record('user_info_field', ['shortname' => 'pet', 'name' => 'Pet', 'required' => 0,
+            'visible' => 1, 'locked' => 0, 'categoryid' => 1, 'datatype' => 'text']);
+
+        set_config('field_map_profile_field_pet', 'animal', 'auth_db');
+        set_config('field_updatelocal_profile_field_pet', 'oncreate', 'auth_db');
+        set_config('field_updateremote_profile_field_pet', '0', 'auth_db');
+        set_config('field_lock_profile_field_pet', 'unlocked', 'auth_db');
+
         // Init the rest of settings.
         set_config('passtype', 'plaintext', 'auth_db');
         set_config('changepasswordurl', '', 'auth_db');
@@ -156,6 +166,7 @@ class auth_db_testcase extends advanced_testcase {
 
     public function test_plugin() {
         global $DB, $CFG;
+        require_once($CFG->dirroot . '/user/profile/lib.php');
 
         $this->resetAfterTest(true);
 
@@ -193,7 +204,7 @@ class auth_db_testcase extends advanced_testcase {
 
         // Test bulk user account creation.
 
-        $user2 = (object)array('name'=>'u2', 'pass'=>'heslo', 'email'=>'u2@example.com');
+        $user2 = (object)['name' => 'u2', 'pass' => 'heslo', 'email' => 'u2@example.com', 'animal' => 'cat'];
         $user2->id = $DB->insert_record('auth_db_users', $user2);
 
         $user3 = (object)array('name'=>'admin', 'pass'=>'heslo', 'email'=>'admin@example.com'); // Should be skipped.
@@ -202,13 +213,24 @@ class auth_db_testcase extends advanced_testcase {
         $this->assertCount(2, $DB->get_records('user'));
 
         $trace = new null_progress_trace();
+
+        // Sync users and make sure that two events user_created werer triggered.
+        $sink = $this->redirectEvents();
         $auth->sync_users($trace, false);
+        $events = $sink->get_events();
+        $sink->close();
+        $this->assertCount(2, $events);
+        $this->assertTrue($events[0] instanceof  \core\event\user_created);
+        $this->assertTrue($events[1] instanceof  \core\event\user_created);
 
+        // Assert the two users were created.
         $this->assertEquals(4, $DB->count_records('user'));
         $u1 = $DB->get_record('user', array('username'=>$user1->name, 'auth'=>'db'));
         $this->assertSame($user1->email, $u1->email);
+        $this->assertEmpty(profile_user_record($u1->id)->pet);
         $u2 = $DB->get_record('user', array('username'=>$user2->name, 'auth'=>'db'));
         $this->assertSame($user2->email, $u2->email);
+        $this->assertSame($user2->animal, profile_user_record($u2->id)->pet);
         $admin = $DB->get_record('user', array('username'=>'admin', 'auth'=>'manual'));
         $this->assertNotEmpty($admin);
 
@@ -217,12 +239,14 @@ class auth_db_testcase extends advanced_testcase {
 
         $user2b = clone($user2);
         $user2b->email = 'u2b@example.com';
+        $user2b->animal = 'dog';
         $DB->update_record('auth_db_users', $user2b);
 
         $auth->sync_users($trace, false);
         $this->assertEquals(4, $DB->count_records('user'));
         $u2 = $DB->get_record('user', array('username'=>$user2->name));
         $this->assertSame($user2->email, $u2->email);
+        $this->assertSame($user2->animal, profile_user_record($u2->id)->pet);
 
         $auth->sync_users($trace, true);
         $this->assertEquals(4, $DB->count_records('user'));
@@ -231,6 +255,8 @@ class auth_db_testcase extends advanced_testcase {
 
         set_config('field_updatelocal_email', 'onlogin', 'auth_db');
         $auth->config->field_updatelocal_email = 'onlogin';
+        set_config('field_updatelocal_profile_field_pet', 'onlogin', 'auth_db');
+        $auth->config->field_updatelocal_profile_field_pet = 'onlogin';
 
         $auth->sync_users($trace, false);
         $this->assertEquals(4, $DB->count_records('user'));
@@ -241,6 +267,7 @@ class auth_db_testcase extends advanced_testcase {
         $this->assertEquals(4, $DB->count_records('user'));
         $u2 = $DB->get_record('user', array('username'=>$user2->name));
         $this->assertSame($user2b->email, $u2->email);
+        $this->assertSame($user2b->animal, profile_user_record($u2->id)->pet);
 
 
         // Test sync deletes and suspends.
index a6896eb..c10bec2 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_db';         // Full name of the plugin (used for diagnostics)
index c641c84..47e43b2 100644 (file)
@@ -47,5 +47,8 @@ function xmldb_auth_email_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index aa0fb66..4afb168 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die;
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_email';      // Full name of the plugin (used for diagnostics)
index bfe0e36..962ff83 100644 (file)
@@ -55,5 +55,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2020081700, 'auth', 'ldap');
     }
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 9ac96d2..3efc51f 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020081700;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_ldap';       // Full name of the plugin (used for diagnostics)
index 387670a..0c00bdb 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2020060900; // Requires this Moodle version.
+$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2020110300; // Requires this Moodle version.
 $plugin->component = 'auth_lti'; // Full name of the plugin (used for diagnostics).
index ced0da1..f90db80 100644 (file)
@@ -47,5 +47,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 896f866..31140ae 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_manual';     // Full name of the plugin (used for diagnostics)
index f9fabc1..b97a10d 100644 (file)
@@ -47,5 +47,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c579967..e6e8be5 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_mnet';       // Full name of the plugin (used for diagnostics)
index 249d99b..d7cf6a7 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_nologin';    // Full name of the plugin (used for diagnostics)
index 1d17e36..41fc21e 100644 (file)
@@ -47,5 +47,8 @@ function xmldb_auth_none_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 5520d23..684bff5 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_none';       // Full name of the plugin (used for diagnostics)
index d9d50b8..f977861 100644 (file)
@@ -84,5 +84,8 @@ function xmldb_auth_oauth2_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 22fe0b6..78d5500 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900;        // Requires this Moodle version.
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300;        // Requires this Moodle version.
 $plugin->component = 'auth_oauth2';       // Full name of the plugin (used for diagnostics).
index b16539d..191dd3f 100644 (file)
@@ -47,5 +47,8 @@ function xmldb_auth_shibboleth_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 9898bc0..9b5ba8e 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_shibboleth'; // Full name of the plugin (used for diagnostics)
index b880c4b..a8d821a 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'auth_webservice'; // Full name of the plugin (used for diagnostics)
index 6883cc9..35f2129 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'availability_completion';
index e682886..678885f 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'availability_date';
index 9acc029..b16c99d 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'availability_grade';
index 4701076..588a026 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'availability_group';
index 6efb1ad..fe05a24 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'availability_grouping';
index 1eedfc8..bf4eea0 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version = 2020061500;
-$plugin->requires = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires = 2020110300;
 $plugin->component = 'availability_profile';
index 3a57d04..1defc0c 100644 (file)
@@ -156,7 +156,7 @@ abstract class backup implements checksumable {
      * point is backup when some behavior/approach channged, in order to allow
      * conditional coding based on it.
      */
-    const VERSION = 2020061500;
+    const VERSION = 2020110900;
     /**
      * Usually same than major release zero version, mainly for informative/historic purposes.
      */
index 39c4116..f73cb3f 100644 (file)
@@ -369,6 +369,7 @@ class restore_controller extends base_controller {
             $options = array();
             $options['keep_roles_and_enrolments'] = $this->get_setting_value('keep_roles_and_enrolments');
             $options['keep_groups_and_groupings'] = $this->get_setting_value('keep_groups_and_groupings');
+            $options['userid'] = $this->userid;
             restore_dbops::delete_course_content($this->get_courseid(), $options);
         }
         // If this is not a course restore or single activity restore (e.g. duplicate), inform the plan we are not
index 69fcf19..8108f6e 100644 (file)
@@ -2121,14 +2121,29 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
         $data = (object)$data;
 
         // Check roleid is one of the mapped ones
-        $newroleid = $this->get_mappingid('role', $data->roleid);
+        $newrole = $this->get_mapping('role', $data->roleid);
+        $newroleid = $newrole->newitemid ?? false;
+        $userid = $this->task->get_userid();
+
         // If newroleid and context are valid assign it via API (it handles dupes and so on)
         if ($newroleid && $this->task->get_contextid()) {
-            if (!get_capability_info($data->capability)) {
+            if (!$capability = get_capability_info($data->capability)) {
                 $this->log("Capability '{$data->capability}' was not found!", backup::LOG_WARNING);
             } else {
-                // TODO: assign_capability() needs one userid param to be able to specify our restore userid.
-                assign_capability($data->capability, $data->permission, $newroleid, $this->task->get_contextid());
+                $context = context::instance_by_id($this->task->get_contextid());
+                $overrideableroles = get_overridable_roles($context, ROLENAME_SHORT);
+                $safecapability = is_safe_capability($capability);
+
+                // Check if the new role is an overrideable role AND if the user performing the restore has the
+                // capability to assign the capability.
+                if (in_array($newrole->info['shortname'], $overrideableroles) &&
+                    ($safecapability && has_capability('moodle/role:safeoverride', $context, $userid) ||
+                        !$safecapability && has_capability('moodle/role:override', $context, $userid))
+                ) {
+                    assign_capability($data->capability, $data->permission, $newroleid, $this->task->get_contextid());
+                } else {
+                    $this->log("Insufficient capability to assign capability '{$data->capability}' to role!", backup::LOG_WARNING);
+                }
             }
         }
     }
@@ -2148,11 +2163,22 @@ class restore_default_enrolments_step extends restore_execution_step {
         }
 
         $course = $DB->get_record('course', array('id'=>$this->get_courseid()), '*', MUST_EXIST);
+        // Return any existing course enrolment instances.
+        $enrolinstances = enrol_get_instances($course->id, false);
+
+        if ($enrolinstances) {
+            // Something already added instances.
+            // Get the existing enrolment methods in the course.
+            $enrolmethods = array_map(function($enrolinstance) {
+                return $enrolinstance->enrol;
+            }, $enrolinstances);
 
-        if ($DB->record_exists('enrol', array('courseid'=>$this->get_courseid(), 'enrol'=>'manual'))) {
-            // Something already added instances, do not add default instances.
             $plugins = enrol_get_plugins(true);
-            foreach ($plugins as $plugin) {
+            foreach ($plugins as $pluginname => $plugin) {
+                // Make sure all default enrolment methods exist in the course.
+                if (!in_array($pluginname, $enrolmethods)) {
+                    $plugin->course_updated(true, $course, null);
+                }
                 $plugin->restore_sync_course($course);
             }
 
index 2e2478b..1ff7795 100644 (file)
@@ -98,7 +98,7 @@ if (!empty($issuedbadge->recipient->id)) {
                 $assertionid
             );
 
-            if (!$assertionentityid && strpos($sitebackpack->backpackapiurl, 'badgr')) {
+            if ($assertionentityid && strpos($sitebackpack->backpackapiurl, 'badgr')) {
                 $assertionentityid = badges_generate_badgr_open_url(
                     $sitebackpack,
                     OPEN_BADGES_V2_TYPE_ASSERTION,
index 4e1e393..78e86b0 100644 (file)
@@ -39,6 +39,20 @@ use stdClass;
  */
 class assertion_exporter extends exporter {
 
+    /**
+     * Constructor - saves the persistent object, and the related objects.
+     *
+     * @param mixed $data - Either an stdClass or an array of values.
+     * @param array $related - An optional list of pre-loaded objects related to this object.
+     */
+    public function __construct($data, $related = array()) {
+        // Having mixed $data is causing some issues. As this class is treating $data as an object everywhere, it can be converted
+        // to object at this point, to avoid errors and get the expected behaviour always.
+        // $data is an array when this class is a request exporter in backpack_api_mapping, but it is an object when this is
+        // used as a response exporter.
+        parent::__construct((object) $data, $related);
+    }
+
     /**
      * Map from a request response data to the internal structure.
      *
@@ -104,16 +118,16 @@ class assertion_exporter extends exporter {
         global $DB;
         $result = [];
 
-        if (array_key_exists('related_badge', $this->data)) {
-            $exporter = new badgeclass_exporter($this->data['related_badge'], $this->related);
+        if (property_exists($this->data, 'related_badge')) {
+            $exporter = new badgeclass_exporter($this->data->related_badge, $this->related);
             $result['badge'] = $exporter->export($output);
         }
-        if (array_key_exists('related_recipient', $this->data)) {
-            $exporter = new recipient_exporter($this->data['related_recipient'], $this->related);
+        if (property_exists($this->data, 'related_recipient')) {
+            $exporter = new recipient_exporter($this->data->related_recipient, $this->related);
             $result['recipient'] = $exporter->export($output);
         }
-        if (array_key_exists('related_verify', $this->data)) {
-            $exporter = new verification_exporter($this->data['related_verify'], $this->related);
+        if (property_exists($this->data, 'related_verify')) {
+            $exporter = new verification_exporter($this->data->related_verify, $this->related);
             $result['verification'] = $exporter->export($output);
         }
         return $result;
index f16d762..9aee956 100644 (file)
@@ -45,6 +45,12 @@ class badgeclass_exporter extends exporter {
      * @param array $related - An optional list of pre-loaded objects related to this object.
      */
     public function __construct($data, $related = array()) {
+        // Having mixed $data is causing some issues. As this class is treating $data as an object everywhere, it can be converted
+        // to object at this point, to avoid errors and get the expected behaviour always.
+        // $data is an array when this class is a request exporter in backpack_api_mapping, but it is an object when this is
+        // used as a response exporter.
+        $data = (object) $data;
+
         $pick = $this->pick_related();
         foreach ($pick as $one) {
             $isarray = false;
@@ -54,28 +60,28 @@ class badgeclass_exporter extends exporter {
                 $isarray = true;
             }
             $prefixed = 'related_' . $one;
-            if (array_key_exists($one, $data) && !array_key_exists($one, $related)) {
+            if (property_exists($data, $one) && !array_key_exists($one, $related)) {
                 if ($isarray) {
                     $newrelated = [];
-                    foreach ($data[$one] as $item) {
+                    foreach ($data->$one as $item) {
                         $newrelated[] = (object) $item;
                     }
                     $related[$one] = $newrelated;
                 } else {
-                    $related[$one] = (object) $data[$one];
+                    $related[$one] = (object) $data->$one;
                 }
-                unset($data[$one]);
-            } else if (array_key_exists($prefixed, $data) && !array_key_exists($one, $related)) {
+                unset($data->$one);
+            } else if (property_exists($data, $prefixed) && !array_key_exists($one, $related)) {
                 if ($isarray) {
                     $newrelated = [];
-                    foreach ($data[$prefixed] as $item) {
+                    foreach ($data->$prefixed as $item) {
                         $newrelated[] = (object) $item;
                     }
                     $related[$one] = $newrelated;
                 } else {
-                    $related[$one] = (object) $data[$prefixed];
+                    $related[$one] = (object) $data->$prefixed;
                 }
-                unset($data[$prefixed]);
+                unset($data->$prefixed);
             } else if (!array_key_exists($one, $related)) {
                 $related[$one] = null;
             }
index b561bfe..13415fd 100644 (file)
@@ -805,7 +805,7 @@ class core_badges_renderer extends plugin_renderer_base {
                 );
 
         if (has_capability('moodle/badges:configuredetails', $context)) {
-            $row[] = new tabobject('details',
+            $row[] = new tabobject('badge',
                         new moodle_url('/badges/edit.php', array('id' => $badgeid, 'action' => 'badge')),
                         get_string('bdetails', 'badges')
                     );
@@ -856,7 +856,7 @@ class core_badges_renderer extends plugin_renderer_base {
         if (has_capability('moodle/badges:configuredetails', $context)) {
             $alignments = $DB->count_records_sql("SELECT COUNT(bc.id)
                       FROM {badge_alignment} bc WHERE bc.badgeid = :badgeid", array('badgeid' => $badgeid));
-            $row[] = new tabobject('balignment',
+            $row[] = new tabobject('alignment',
                 new moodle_url('/badges/alignment.php', array('id' => $badgeid)),
                 get_string('balignment', 'badges', $alignments)
             );
index e8a6956..f764c8a 100644 (file)
@@ -1012,41 +1012,40 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
         ];
     }
 
-
     /**
-     * Test badges_save_external_backpack without any auth details and also tests duplicate entries.
+     * Test badges_save_external_backpack.
      *
-     * @param boolean $withauth Test with authentication details provided
-     * @param boolean $duplicates Test for duplicates
-     * @dataProvider test_badges_save_external_backpack_provider
-     * @throws dml_exception
+     * @dataProvider badges_save_external_backpack_provider
+     * @param  array $data  Backpack data to save.
+     * @param  bool $adduser True if a real user has to be used for creating the backpack; false otherwise.
+     * @param  bool $duplicates True if duplicates has to be tested too; false otherwise.
      */
-    public function test_badges_save_external_backpack($withauth, $duplicates) {
+    public function test_badges_save_external_backpack(array $data, bool $adduser, bool $duplicates) {
         global $DB;
-        $this->resetAfterTest();
-        $user = $this->getDataGenerator()->create_user();
 
-        $data = [
-            'userid' => $user->id,
-            'apiversion' => 2,
-            'backpackapiurl' => 'https://api.ca.badgr.io/v2',
-            'backpackweburl' => 'https://ca.badgr.io',
-        ];
+        $this->resetAfterTest();
 
-        if ($withauth) {
-            $data['backpackemail'] = 'test@test.com';
-            $data['password'] = 'test';
+        $userid = 0;
+        if ($adduser) {
+            $user = $this->getDataGenerator()->create_user();
+            $userid = $user->id;
+            $data['userid'] = $user->id;
         }
 
         $result = badges_save_external_backpack((object) $data);
+        $this->assertNotEquals(0, $result);
         $record = $DB->get_record('badge_external_backpack', ['id' => $result]);
         $this->assertEquals($record->backpackweburl, $data['backpackweburl']);
         $this->assertEquals($record->backpackapiurl, $data['backpackapiurl']);
-        $record = $DB->get_record('badge_backpack', ['userid' => $user->id]);
-        if (!$withauth) {
+
+        $record = $DB->get_record('badge_backpack', ['externalbackpackid' => $result]);
+        if (!array_key_exists('backpackemail', $data) && !array_key_exists('password', $data)) {
             $this->assertEmpty($record);
+            $total = $DB->count_records('badge_backpack');
+            $this->assertEquals(0, $total);
         } else {
             $this->assertNotEmpty($record);
+            $this->assertEquals($record->userid, $userid);
         }
 
         if ($duplicates) {
@@ -1061,19 +1060,66 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
      *
      * @return array
      */
-    public function test_badges_save_external_backpack_provider() {
+    public function badges_save_external_backpack_provider() {
+        $data = [
+            'apiversion' => 2,
+            'backpackapiurl' => 'https://api.ca.badgr.io/v2',
+            'backpackweburl' => 'https://ca.badgr.io',
+        ];
         return [
-            "Test without any auth details and duplicates" => [
-                false, true
+            'Test without user and auth details. Check duplicates too' => [
+                'data' => $data,
+                'adduser' => false,
+                'duplicates' => true,
+            ],
+            'Test without user and auth details. No duplicates' => [
+                'data' => $data,
+                'adduser' => false,
+                'duplicates' => false,
+            ],
+            'Test with user and without auth details' => [
+                'data' => $data,
+                'adduser' => true,
+                'duplicates' => false,
+            ],
+            'Test with user and without auth details. Check duplicates too' => [
+                'data' => $data,
+                'adduser' => true,
+                'duplicates' => true,
+            ],
+            'Test with empty backpackemail, password and id' => [
+                'data' => array_merge($data, [
+                    'backpackemail' => '',
+                    'password' => '',
+                    'id' => 0,
+                ]),
+                'adduser' => false,
+                'duplicates' => false,
             ],
-            "Test without any auth details and without duplicates" => [
-                false, false
+            'Test with empty backpackemail, password and id but with user' => [
+                'data' => array_merge($data, [
+                    'backpackemail' => '',
+                    'password' => '',
+                    'id' => 0,
+                ]),
+                'adduser' => true,
+                'duplicates' => false,
             ],
-            "Test with auth details and duplicates" => [
-                true, true
+            'Test with auth details but without user' => [
+                'data' => array_merge($data, [
+                    'backpackemail' => 'test@test.com',
+                    'password' => 'test',
+                ]),
+                'adduser' => false,
+                'duplicates' => false,
             ],
-            "Test with any auth details and duplicates" => [
-                true, false
+            'Test with auth details and user' => [
+                'data' => array_merge($data, [
+                    'backpackemail' => 'test@test.com',
+                    'password' => 'test',
+                ]),
+                'adduser' => true,
+                'duplicates' => false,
             ],
         ];
     }
@@ -1083,7 +1129,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
      *
      * @param boolean $isadmin
      * @param boolean $updatetest
-     * @dataProvider test_badges_create_site_backpack_provider
+     * @dataProvider badges_create_site_backpack_provider
      */
     public function test_badges_create_site_backpack($isadmin, $updatetest) {
         global $DB;
@@ -1129,7 +1175,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
     /**
      * Provider for test_badges_(create/update)_site_backpack
      */
-    public function test_badges_create_site_backpack_provider() {
+    public function badges_create_site_backpack_provider() {
         return [
             "Test as admin user - creation test" => [true, true],
             "Test as admin user - update test" => [true, false],
@@ -1253,7 +1299,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
      * Test the badges_get_site_primary_backpack function
      *
      * @param boolean $withauth Testing with authentication or not.
-     * @dataProvider test_badges_get_site_primary_backpack_provider
+     * @dataProvider badges_get_site_primary_backpack_provider
      */
     public function test_badges_get_site_primary_backpack($withauth) {
         $data = [
@@ -1289,7 +1335,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
      *
      * @return array
      */
-    public function test_badges_get_site_primary_backpack_provider() {
+    public function badges_get_site_primary_backpack_provider() {
         return [
             "Test with auth details" => [true],
             "Test without auth details" => [false],
index 071cfc2..0254c9e 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_activity_modules'; // Full name of the plugin (used for diagnostics)
index 65ced1e..ea9af0c 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;               // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900;               // Requires this Moodle version.
+$plugin->version   = 2020110900;               // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300;               // Requires this Moodle version.
 $plugin->component = 'block_activity_results'; // Full name of the plugin (used for diagnostics).
\ No newline at end of file
index de90f7b..711dd65 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_admin_bookmarks'; // Full name of the plugin (used for diagnostics)
index 6a1cc4d..ecf0643 100644 (file)
@@ -60,5 +60,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d41ed7a..b842643 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900;        // Requires this Moodle version.
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300;        // Requires this Moodle version.
 $plugin->component = 'block_badges';
index af5acfd..9afc48d 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_blog_menu'; // Full name of the plugin (used for diagnostics)
index 4fb1a60..2760418 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_blog_recent'; // Full name of the plugin (used for diagnostics)
index c6f68da..e24c9e9 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_blog_tags'; // Full name of the plugin (used for diagnostics)
index ce70f8b..62a3293 100644 (file)
@@ -60,5 +60,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 46885f1..966ee78 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_calendar_month'; // Full name of the plugin (used for diagnostics)
index 3c6cee0..e3759d0 100644 (file)
@@ -60,5 +60,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 7a91fe7..1959186 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_calendar_upcoming'; // Full name of the plugin (used for diagnostics)
index cc08180..41cddfa 100644 (file)
@@ -92,6 +92,9 @@ class core_block_external extends external_api {
     private static function get_all_current_page_blocks($includeinvisible = false, $returncontents = false) {
         global $PAGE, $OUTPUT;
 
+        // Set page URL to a fake URL to avoid errors.
+        $PAGE->set_url(new \moodle_url('/webservice/core_block_external/'));
+
         // Load the block instances for all the regions.
         $PAGE->blocks->load_blocks($includeinvisible);
         $PAGE->blocks->create_all_block_instances();
index 180b568..17bed6b 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_comments'; // Full name of the plugin (used for diagnostics)
index 433fb4f..8e1c300 100644 (file)
@@ -63,5 +63,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 29487d8..8a27f58 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version      = 2020061500; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires     = 2020060900; // Requires this Moodle version.
+$plugin->version      = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires     = 2020110300; // Requires this Moodle version.
 $plugin->component    = 'block_completionstatus';
-$plugin->dependencies = array('report_completion' => 2020060900);
+$plugin->dependencies = array('report_completion' => 2020110300);
index 81a8ade..f453d6f 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_course_list'; // Full name of the plugin (used for diagnostics)
index 7fea414..f499329 100644 (file)
@@ -63,5 +63,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index ddf8b7b..a8f24e5 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_course_summary'; // Full name of the plugin (used for diagnostics)
index 3e137af..5b5956c 100644 (file)
@@ -24,8 +24,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_feedback';  // Full name of the plugin (used for diagnostics)
 
-$plugin->dependencies = array('mod_feedback' => 2020060900);
+$plugin->dependencies = array('mod_feedback' => 2020110300);
index 89324c8..b224101 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die;
 
-$plugin->version = 2020061500;
-$plugin->requires  = 2020060900;
+$plugin->version = 2020110900;
+$plugin->requires  = 2020110300;
 $plugin->component = 'block_globalsearch';
index cb2cb33..e2106e8 100644 (file)
@@ -24,8 +24,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_glossary_random'; // Full name of the plugin (used for diagnostics)
 
-$plugin->dependencies = array('mod_glossary' => 2020060900);
+$plugin->dependencies = array('mod_glossary' => 2020110300);
index e228620..c74adb5 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_block_html_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 2a5aa61..89e7d86 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_html';      // Full name of the plugin (used for diagnostics)
index 1054144..ae9a2d9 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_login';     // Full name of the plugin (used for diagnostics)
index f03ab7c..e0b7f99 100644 (file)
@@ -24,8 +24,8 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;
-$plugin->requires  = 2020060900;
+$plugin->version   = 2020110900;
+$plugin->requires  = 2020110300;
 $plugin->component = 'block_lp';
 $plugin->dependencies = array(
     'tool_lp' => ANY_VERSION
index 7849e00..ee43ceb 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_mentees';   // Full name of the plugin (used for diagnostics)
index 55c1106..5ccdd94 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_mnet_hosts'; // Full name of the plugin (used for diagnostics)
index 8239818..8e774f5 100644 (file)
@@ -81,5 +81,8 @@ function xmldb_block_myoverview_upgrade($oldversion) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 2769409..c129d5e 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;         // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires  = 2020060900;         // Requires this Moodle version.
+$plugin->version   = 2020110900;         // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires  = 2020110300;         // Requires this Moodle version.
 $plugin->component = 'block_myoverview'; // Full name of the plugin (used for diagnostics).
index e7b6704..668ca8d 100644 (file)
@@ -25,6 +25,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_myprofile'; // Full name of the plugin (used for diagnostics)
index c7ffa31..a7be67f 100644 (file)
@@ -70,5 +70,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.10.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 952772f..12ad154 100644 (file)
@@ -24,6 +24,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2020061500;        // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires  = 2020060900;        // Requires this Moodle version
+$plugin->version   = 2020110900;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires  = 2020110300;        // Requires this Moodle version
 $plugin->component = 'block_navigation'; // Full name of the plugin (used for diagnostics)