mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Merge branch 'MDL-81870' of https://github.com/paulholden/moodle
This commit is contained in:
commit
3a60821242
@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
$string['authpluginnotfound'] = 'Authentication plugin {$a} not found.';
|
||||
$string['blocknotexist'] = '{$a} block doesn\'t exist';
|
||||
$string['cannotbenull'] = '{$a} cannot be null!';
|
||||
$string['cannotdowngrade'] = 'Cannot downgrade {$a->plugin} from {$a->oldversion} to {$a->newversion}.';
|
||||
$string['cannotfindadmin'] = 'Could not find an admin user!';
|
||||
@ -39,7 +38,6 @@ $string['invalidparameter'] = 'Invalid parameter value detected';
|
||||
$string['invalidresponse'] = 'Invalid response value detected';
|
||||
$string['line'] = 'Line';
|
||||
$string['missingconfigversion'] = 'Config table does not contain the version. You cannot continue.';
|
||||
$string['modulenotexist'] = '{$a} module doesn\'t exist';
|
||||
$string['morethanonerecordinfetch'] = 'Found more than one record in fetch() !';
|
||||
$string['mustbeoveride'] = 'Abstract {$a} method must be overridden.';
|
||||
$string['noadminrole'] = 'No admin role could be found';
|
||||
@ -68,3 +66,7 @@ $string['sqlrelyonobsoletetable'] = 'This SQL relies on obsolete table(s): {$a}!
|
||||
$string['stacktrace'] = 'Stack trace';
|
||||
$string['withoutversion'] = 'Main version.php file is missing, not readable or broken.';
|
||||
$string['xmlizeunavailable'] = 'xmlize functions are not available';
|
||||
|
||||
// Deprecated since Moodle 4.5.
|
||||
$string['blocknotexist'] = '{$a} block doesn\'t exist';
|
||||
$string['modulenotexist'] = '{$a} module doesn\'t exist';
|
||||
|
@ -110,5 +110,7 @@ aria:dropdowngrades,core_grades
|
||||
viewresults,core
|
||||
coursesearch,core
|
||||
coursesearch_help,core
|
||||
blocknotexist,core_debug
|
||||
modulenotexist,core_debug
|
||||
coursecalendar,core_calendar
|
||||
datechanged,core
|
||||
|
@ -504,6 +504,7 @@ $string['pagenotexist'] = '<p>An unusual error occurred trying to view a page th
|
||||
$string['passwordexceeded'] = 'The password can\'t be more than {$a} characters.';
|
||||
$string['pathdoesnotstartslash'] = 'No valid arguments supplied, path does not start with slash!';
|
||||
$string['pleasereport'] = 'If you have time, please let us know what you were trying to do when the error occurred:';
|
||||
$string['pluginnotexist'] = '{$a} plugin doesn\'t exist';
|
||||
$string['pluginrequirementsnotmet'] = 'Plugin "{$a->pluginname}" ({$a->pluginversion}) could not be installed. It requires a newer version of Moodle (currently you are using {$a->currentmoodle}, you need {$a->requiremoodle}).';
|
||||
$string['pluginunsupported'] = 'Plugin "{$a->pluginname}" {$a->pluginversion} does not support this version of Moodle {$a->moodleversion}. Seek plugin information to find supported versions.';
|
||||
$string['prefixcannotbeempty'] = '<p>Error: database table prefix cannot be empty ({$a})</p>
|
||||
|
@ -373,43 +373,12 @@ function upgrade_main_savepoint($result, $version, $allowabort=true) {
|
||||
*
|
||||
* @category upgrade
|
||||
* @param bool $result false if upgrade step failed, true if completed
|
||||
* @param string or float $version main version
|
||||
* @param string|float $version main version
|
||||
* @param string $modname name of module
|
||||
* @param bool $allowabort allow user to abort script execution here
|
||||
* @return void
|
||||
*/
|
||||
function upgrade_mod_savepoint($result, $version, $modname, $allowabort=true) {
|
||||
global $DB;
|
||||
|
||||
$component = 'mod_'.$modname;
|
||||
|
||||
if (!$result) {
|
||||
throw new upgrade_exception($component, $version);
|
||||
}
|
||||
|
||||
$dbversion = $DB->get_field('config_plugins', 'value', array('plugin'=>$component, 'name'=>'version'));
|
||||
|
||||
if (!$module = $DB->get_record('modules', array('name'=>$modname))) {
|
||||
throw new \moodle_exception('modulenotexist', 'debug', '', $modname);
|
||||
}
|
||||
|
||||
if ($dbversion >= $version) {
|
||||
// something really wrong is going on in upgrade script
|
||||
throw new downgrade_exception($component, $dbversion, $version);
|
||||
}
|
||||
set_config('version', $version, $component);
|
||||
|
||||
upgrade_log(UPGRADE_LOG_NORMAL, $component, 'Upgrade savepoint reached');
|
||||
|
||||
// reset upgrade timeout to default
|
||||
upgrade_set_timeout();
|
||||
|
||||
core_upgrade_time::record_savepoint($version);
|
||||
|
||||
// this is a safe place to stop upgrades if user aborts page loading
|
||||
if ($allowabort and connection_aborted()) {
|
||||
die;
|
||||
}
|
||||
upgrade_plugin_savepoint($result, $version, 'mod', $modname, $allowabort);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -419,57 +388,25 @@ function upgrade_mod_savepoint($result, $version, $modname, $allowabort=true) {
|
||||
*
|
||||
* @category upgrade
|
||||
* @param bool $result false if upgrade step failed, true if completed
|
||||
* @param string or float $version main version
|
||||
* @param string|float $version main version
|
||||
* @param string $blockname name of block
|
||||
* @param bool $allowabort allow user to abort script execution here
|
||||
* @return void
|
||||
*/
|
||||
function upgrade_block_savepoint($result, $version, $blockname, $allowabort=true) {
|
||||
global $DB;
|
||||
|
||||
$component = 'block_'.$blockname;
|
||||
|
||||
if (!$result) {
|
||||
throw new upgrade_exception($component, $version);
|
||||
}
|
||||
|
||||
$dbversion = $DB->get_field('config_plugins', 'value', array('plugin'=>$component, 'name'=>'version'));
|
||||
|
||||
if (!$block = $DB->get_record('block', array('name'=>$blockname))) {
|
||||
throw new \moodle_exception('blocknotexist', 'debug', '', $blockname);
|
||||
}
|
||||
|
||||
if ($dbversion >= $version) {
|
||||
// something really wrong is going on in upgrade script
|
||||
throw new downgrade_exception($component, $dbversion, $version);
|
||||
}
|
||||
set_config('version', $version, $component);
|
||||
|
||||
upgrade_log(UPGRADE_LOG_NORMAL, $component, 'Upgrade savepoint reached');
|
||||
|
||||
// reset upgrade timeout to default
|
||||
upgrade_set_timeout();
|
||||
|
||||
core_upgrade_time::record_savepoint($version);
|
||||
|
||||
// this is a safe place to stop upgrades if user aborts page loading
|
||||
if ($allowabort and connection_aborted()) {
|
||||
die;
|
||||
}
|
||||
upgrade_plugin_savepoint($result, $version, 'block', $blockname, $allowabort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugins upgrade savepoint, marks end of blocks upgrade blocks
|
||||
* Plugins upgrade savepoint, marks end of plugin upgrade blocks
|
||||
* It stores plugin version, resets upgrade timeout
|
||||
* and abort upgrade if user cancels page loading.
|
||||
*
|
||||
* @category upgrade
|
||||
* @param bool $result false if upgrade step failed, true if completed
|
||||
* @param string or float $version main version
|
||||
* @param string|float $version main version
|
||||
* @param string $type The type of the plugin.
|
||||
* @param string $plugin The name of the plugin.
|
||||
* @param bool $allowabort allow user to abort script execution here
|
||||
* @return void
|
||||
*/
|
||||
function upgrade_plugin_savepoint($result, $version, $type, $plugin, $allowabort=true) {
|
||||
global $DB;
|
||||
@ -480,6 +417,11 @@ function upgrade_plugin_savepoint($result, $version, $type, $plugin, $allowabort
|
||||
throw new upgrade_exception($component, $version);
|
||||
}
|
||||
|
||||
// Ensure we're dealing with a real component.
|
||||
if (core_component::get_component_directory($component) === null) {
|
||||
throw new moodle_exception('pluginnotexist', 'error', '', $component);
|
||||
}
|
||||
|
||||
$dbversion = $DB->get_field('config_plugins', 'value', array('plugin'=>$component, 'name'=>'version'));
|
||||
|
||||
if ($dbversion >= $version) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user