diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index 40bd6b339e3..f0d7455e592 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -162,6 +162,7 @@ class core_plugin_manager { $this->installedplugins = array(); + // TODO: Delete this block once Moodle 2.6 or later becomes minimum required version to upgrade. if ($CFG->version < 2013092001.02) { // We did not upgrade the database yet. $modules = $DB->get_records('modules', array(), 'name ASC', 'id, name, version'); diff --git a/lib/upgrade.txt b/lib/upgrade.txt index c8279d4fef9..508fa8d3b7c 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -6,6 +6,7 @@ information provided here is intended especially for developers. * $core_renderer->block_move_target() changed to support more verbose move-block-here descriptions. DEPRECATIONS: +* $module uses in mod/xxx/version.php files is now deprecated. Please use $plugin instead. It will be removed in Moodle 2.10. * Update init methods in all event classes - "level" property was renamed to "edulevel", the level property is now deprecated. * Abstract class \core\event\course_module_instances_list_viewed is deprecated now, use \core\event\instances_list_viewed instead. * mod_book\event\instances_list_viewed has been deprecated. Please use mod_book\event\course_module_instance_list_viewed instead. diff --git a/lib/upgradelib.php b/lib/upgradelib.php index 24563fdd69f..338a5ccf804 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -565,10 +565,11 @@ function upgrade_plugins_modules($startcallback, $endcallback, $verbose) { throw new plugin_defective_exception($component, 'Missing version.php'); } + // TODO: Support for $module will end with Moodle 2.10 by MDL-43896. Was deprecated for Moodle 2.7 by MDL-43040. $plugin = new stdClass(); $plugin->version = null; $module = $plugin; - require($fullmod .'/version.php'); // Defines $module/$plugin with version etc. + require($fullmod .'/version.php'); // Defines $plugin with version etc. $plugin = clone($module); unset($module->version); unset($module->component); diff --git a/mod/assign/version.php b/mod/assign/version.php index 46acd8a567a..0c741d7ec4d 100644 --- a/mod/assign/version.php +++ b/mod/assign/version.php @@ -24,9 +24,9 @@ defined('MOODLE_INTERNAL') || die(); -$module->component = 'mod_assign'; // Full name of the plugin (used for diagnostics). -$module->version = 2014011500; // The current module version (Date: YYYYMMDDXX). -$module->requires = 2013110500; // Requires this Moodle version. -$module->cron = 60; +$plugin->component = 'mod_assign'; // Full name of the plugin (used for diagnostics). +$plugin->version = 2014011500; // The current module version (Date: YYYYMMDDXX). +$plugin->requires = 2013110500; // Requires this Moodle version. +$plugin->cron = 60; diff --git a/mod/assignment/version.php b/mod/assignment/version.php index a90c330df45..6d82aee03e9 100644 --- a/mod/assignment/version.php +++ b/mod/assignment/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013121900; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_assignment'; // Full name of the plugin (used for diagnostics) -$module->cron = 60; +$plugin->version = 2013121900; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_assignment'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 60; diff --git a/mod/book/version.php b/mod/book/version.php index 659b77a0c9b..e3968449a48 100644 --- a/mod/book/version.php +++ b/mod/book/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die; -$module->component = 'mod_book'; // Full name of the plugin (used for diagnostics) -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->cron = 0; // Period for cron to check this module (secs) +$plugin->component = 'mod_book'; // Full name of the plugin (used for diagnostics) +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->cron = 0; // Period for cron to check this module (secs) diff --git a/mod/chat/version.php b/mod/chat/version.php index 220b516b24c..e908573589a 100644 --- a/mod/chat/version.php +++ b/mod/chat/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_chat'; // Full name of the plugin (used for diagnostics) -$module->cron = 300; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_chat'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 300; diff --git a/mod/choice/version.php b/mod/choice/version.php index fd6a8cb156b..b7dd167b928 100644 --- a/mod/choice/version.php +++ b/mod/choice/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_choice'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_choice'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/data/version.php b/mod/data/version.php index 153f615e611..5fb5c635707 100644 --- a/mod/data/version.php +++ b/mod/data/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_data'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_data'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/feedback/version.php b/mod/feedback/version.php index 6e7600fe373..728061769c5 100644 --- a/mod/feedback/version.php +++ b/mod/feedback/version.php @@ -25,9 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_feedback'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_feedback'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; $feedback_version_intern = 1; //this version is used for restore older backups diff --git a/mod/folder/version.php b/mod/folder/version.php index 5e934d5194a..2d32c952e3f 100644 --- a/mod/folder/version.php +++ b/mod/folder/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_folder'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_folder'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/forum/version.php b/mod/forum/version.php index de7944d8fc1..8f874d5cc7a 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_forum'; // Full name of the plugin (used for diagnostics) -$module->cron = 60; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 60; diff --git a/mod/glossary/version.php b/mod/glossary/version.php index e47cc68c2b2..f47503eaebe 100644 --- a/mod/glossary/version.php +++ b/mod/glossary/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_glossary'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_glossary'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/imscp/version.php b/mod/imscp/version.php index 2951a3900e4..7a2e2f3caa5 100644 --- a/mod/imscp/version.php +++ b/mod/imscp/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_imscp'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_imscp'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/label/version.php b/mod/label/version.php index 41011de1bef..5418fb50f27 100644 --- a/mod/label/version.php +++ b/mod/label/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_label'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_label'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/lesson/version.php b/mod/lesson/version.php index 5c905980fcf..cc87aed004f 100644 --- a/mod/lesson/version.php +++ b/mod/lesson/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_lesson'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_lesson'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/lti/version.php b/mod/lti/version.php index 15b671f948d..479538af978 100644 --- a/mod/lti/version.php +++ b/mod/lti/version.php @@ -49,7 +49,7 @@ defined('MOODLE_INTERNAL') || die; -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_lti'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_lti'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/page/version.php b/mod/page/version.php index dcecd6baed2..740da1b2dbe 100644 --- a/mod/page/version.php +++ b/mod/page/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_page'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_page'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/quiz/version.php b/mod/quiz/version.php index c0b8fdce86c..a235ae81a36 100644 --- a/mod/quiz/version.php +++ b/mod/quiz/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2014011306; // The current module version (Date: YYYYMMDDXX). -$module->requires = 2013110500; // Requires this Moodle version. -$module->component = 'mod_quiz'; // Full name of the plugin (used for diagnostics). -$module->cron = 60; +$plugin->version = 2014011306; // The current module version (Date: YYYYMMDDXX). +$plugin->requires = 2013110500; // Requires this Moodle version. +$plugin->component = 'mod_quiz'; // Full name of the plugin (used for diagnostics). +$plugin->cron = 60; diff --git a/mod/resource/version.php b/mod/resource/version.php index 52d213d5c1c..f661d24416c 100644 --- a/mod/resource/version.php +++ b/mod/resource/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_resource'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_resource'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/scorm/version.php b/mod/scorm/version.php index ac3e1b8cd9b..5d370b0e6db 100644 --- a/mod/scorm/version.php +++ b/mod/scorm/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110501; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics) -$module->cron = 300; +$plugin->version = 2013110501; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 300; diff --git a/mod/survey/version.php b/mod/survey/version.php index 69a2d99cfb5..f25761fb1bb 100644 --- a/mod/survey/version.php +++ b/mod/survey/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_survey'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_survey'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/url/version.php b/mod/url/version.php index 0927d69f749..539d83dd23f 100644 --- a/mod/url/version.php +++ b/mod/url/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_url'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_url'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/wiki/version.php b/mod/wiki/version.php index f101ccf8024..31c56e23fcd 100644 --- a/mod/wiki/version.php +++ b/mod/wiki/version.php @@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2013110500; // Requires this Moodle version -$module->component = 'mod_wiki'; // Full name of the plugin (used for diagnostics) -$module->cron = 0; +$plugin->version = 2013110500; // The current module version (Date: YYYYMMDDXX) +$plugin->requires = 2013110500; // Requires this Moodle version +$plugin->component = 'mod_wiki'; // Full name of the plugin (used for diagnostics) +$plugin->cron = 0; diff --git a/mod/workshop/version.php b/mod/workshop/version.php index a810e1f7d64..49acb263383 100644 --- a/mod/workshop/version.php +++ b/mod/workshop/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2013110500; // the current module version (YYYYMMDDXX) -$module->requires = 2013110500; // requires this Moodle version -$module->component = 'mod_workshop'; // full name of the plugin (used for diagnostics) -$module->cron = 60; // give as a chance every minute +$plugin->version = 2013110500; // the current module version (YYYYMMDDXX) +$plugin->requires = 2013110500; // requires this Moodle version +$plugin->component = 'mod_workshop'; // full name of the plugin (used for diagnostics) +$plugin->cron = 60; // give as a chance every minute