To use this plugin, you must register your site with Google, as described in the documentation Google OAuth 2.0 setup.
As part of the registration process, you will need to enter the following URL as \'Authorized Redirect URIs\':
{$a->callbackurl}
Once registered, you will be provided with a client ID and secret which can be used to configure all Google Drive and Picasa plugins.
'; -$string['oauth2upgrade_message_subject'] = 'Important information regarding Google Drive portfolio plugin'; -$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Google Drive portfolio plugin has been disabled. To re-enable it, your Moodle site needs to be registered with Google, as described in the documentation {$a->docsurl}, in order to obtain a client ID and secret. The client ID and secret can then be used to configure all Google Drive and Picasa plugins.'; -$string['oauth2upgrade_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Google OAuth 2.0 setup.'; $string['pluginname'] = 'Google Drive'; $string['sendfailed'] = 'The file {$a} failed to transfer to google'; $string['secret'] = 'Secret'; diff --git a/portfolio/picasa/db/upgrade.php b/portfolio/picasa/db/upgrade.php index 8b960c6284f..a0efd950faf 100644 --- a/portfolio/picasa/db/upgrade.php +++ b/portfolio/picasa/db/upgrade.php @@ -14,49 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, seeTo use this plugin, you must register your site with Google, as described in the documentation Google OAuth 2.0 setup.
As part of the registration process, you will need to enter the following URL as \'Authorized Redirect URIs\':
{$a->callbackurl}
Once registered, you will be provided with a client ID and secret which can be used to configure all Google Drive and Picasa plugins.
'; -$string['oauth2upgrade_message_subject'] = 'Important information regarding Picasa portfolio plugin'; -$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Picasa portfolio plugin has been disabled. To re-enable it, your Moodle site needs to be registered with Google, as described in the documentation {$a->docsurl}, in order to obtain a client ID and secret. The client ID and secret can then be used to configure all Google Drive and Picasa plugins.'; -$string['oauth2upgrade_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Google OAuth 2.0 setup.'; $string['pluginname'] = 'Picasa'; $string['sendfailed'] = 'The file {$a} failed to transfer to Picasa'; $string['secret'] = 'Secret'; diff --git a/portfolio/upgrade.txt b/portfolio/upgrade.txt index 557a33b34bc..49d49937e6c 100644 --- a/portfolio/upgrade.txt +++ b/portfolio/upgrade.txt @@ -1,6 +1,14 @@ This files describes API changes in /portfolio/ portfolio system, information provided here is intended especially for developers. +=== 3.1 === + +* The following functions, previously used (exclusively) by upgrade steps are not available + anymore because of the upgrade cleanup performed for this version. See MDL-51580 for more info: + - portfolio_picasa_admin_upgrade_notification() + - portfolio_googledocs_admin_upgrade_notification() + - portfolio_boxnet_admin_upgrade_notification() + === 2.4 === The set_callback_options function's third parameter has been changed from a file path diff --git a/question/behaviour/manualgraded/db/upgrade.php b/question/behaviour/manualgraded/db/upgrade.php index 36884f39be6..50cce8de23f 100644 --- a/question/behaviour/manualgraded/db/upgrade.php +++ b/question/behaviour/manualgraded/db/upgrade.php @@ -22,79 +22,13 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Manual graded question behaviour upgrade code. */ function xmldb_qbehaviour_manualgraded_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - // Moodle v2.4.0 release upgrade line - // Put any upgrade step following this - - if ($oldversion < 2013050200) { - // Hide the manualgraded behaviour from the list of behaviours that users - // can select in the user-interface. If a user accidentally chooses manual - // graded behaviour for a quiz, there is no way to get the questions automatically - // graded after the student has answered them. If teachers really want to do - // this they can ask their admin to enable it on the manage behaviours - // screen in the UI. - $disabledbehaviours = get_config('question', 'disabledbehaviours'); - if (!empty($disabledbehaviours)) { - $disabledbehaviours = explode(',', $disabledbehaviours); - } else { - $disabledbehaviours = array(); - } - if (array_search('manualgraded', $disabledbehaviours) === false) { - $disabledbehaviours[] = 'manualgraded'; - set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question'); - } - - // Manual graded question behaviour savepoint reached. - upgrade_plugin_savepoint(true, 2013050200, 'qbehaviour', 'manualgraded'); - } - - if ($oldversion < 2013050800) { - // Also, fix any other admin settings that currently select manualgraded behaviour. - - // Work out a sensible default alternative to manualgraded. - require_once($CFG->libdir . '/questionlib.php'); - $behaviours = question_engine::get_behaviour_options(''); - if (array_key_exists('deferredfeedback', $behaviours)) { - $defaultbehaviour = 'deferredfeedback'; - } else { - reset($behaviours); - $defaultbehaviour = key($behaviours); - } - - // Fix the question preview default. - if (get_config('question_preview', 'behaviour') == 'manualgraded') { - set_config('behaviour', $defaultbehaviour, 'question_preview'); - } - - // Fix the quiz settings default. - if (get_config('quiz', 'preferredbehaviour') == 'manualgraded') { - set_config('preferredbehaviour', $defaultbehaviour, 'quiz'); - } - - // Manual graded question behaviour savepoint reached. - upgrade_plugin_savepoint(true, 2013050800, 'qbehaviour', 'manualgraded'); - } - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. @@ -107,4 +41,3 @@ function xmldb_qbehaviour_manualgraded_upgrade($oldversion) { return true; } - diff --git a/question/type/calculated/db/upgrade.php b/question/type/calculated/db/upgrade.php index 4ad8a0fd381..92f27606f58 100644 --- a/question/type/calculated/db/upgrade.php +++ b/question/type/calculated/db/upgrade.php @@ -23,37 +23,14 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Upgrade code for the calculated question type. * @param int $oldversion the version we are upgrading from. */ function xmldb_qtype_calculated_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - // Moodle v2.2.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.3.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.4.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. @@ -66,5 +43,3 @@ function xmldb_qtype_calculated_upgrade($oldversion) { return true; } - - diff --git a/question/type/essay/db/upgrade.php b/question/type/essay/db/upgrade.php index f990fb3ead3..a33fd4b884f 100644 --- a/question/type/essay/db/upgrade.php +++ b/question/type/essay/db/upgrade.php @@ -23,156 +23,14 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Upgrade code for the essay question type. * @param int $oldversion the version we are upgrading from. */ function xmldb_qtype_essay_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - // Moodle v2.2.0 release upgrade line - // Put any upgrade step following this. - - if ($oldversion < 2011102701) { - $sql = " - FROM {question} q - JOIN {question_answers} qa ON qa.question = q.id - - WHERE q.qtype = 'essay' - AND " . $DB->sql_isnotempty('question_answers', 'feedback', false, true); - // In Moodle <= 2.0 essay had both question.generalfeedback and question_answers.feedback - // This was silly, and in Moodel >= 2.1 only question.generalfeedback. To avoid - // dataloss, we concatenate question_answers.feedback onto the end of question.generalfeedback. - $count = $DB->count_records_sql(" - SELECT COUNT(1) $sql"); - if ($count) { - $progressbar = new progress_bar('essay23', 500, true); - $done = 0; - - $toupdate = $DB->get_recordset_sql(" - SELECT q.id, - q.generalfeedback, - q.generalfeedbackformat, - qa.feedback, - qa.feedbackformat - $sql"); - - foreach ($toupdate as $data) { - $progressbar->update($done, $count, "Updating essay feedback ({$done}/{$count})."); - upgrade_set_timeout(60); - if ($data->generalfeedbackformat == $data->feedbackformat) { - $DB->set_field('question', 'generalfeedback', - $data->generalfeedback . $data->feedback, - array('id' => $data->id)); - - } else { - $newdata = new stdClass(); - $newdata->id = $data->id; - $newdata->generalfeedback = - qtype_essay_convert_to_html($data->generalfeedback, $data->generalfeedbackformat) . - qtype_essay_convert_to_html($data->feedback, $data->feedbackformat); - $newdata->generalfeedbackformat = FORMAT_HTML; - $DB->update_record('question', $newdata); - } - } - - $progressbar->update($count, $count, "Updating essay feedback complete!"); - $toupdate->close(); - } - - // Essay savepoint reached. - upgrade_plugin_savepoint(true, 2011102701, 'qtype', 'essay'); - } - - if ($oldversion < 2011102702) { - // Then we delete the old question_answers rows for essay questions. - $DB->delete_records_select('question_answers', - "question IN (SELECT id FROM {question} WHERE qtype = 'essay')"); - - // Essay savepoint reached. - upgrade_plugin_savepoint(true, 2011102702, 'qtype', 'essay'); - } - - // Moodle v2.3.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.4.0 release upgrade line - // Put any upgrade step following this. - - if ($oldversion < 2013011800) { - // Then we delete the old question_answers rows for essay questions. - $DB->delete_records_select('qtype_essay_options', "NOT EXISTS ( - SELECT 1 FROM {question} WHERE qtype = 'essay' AND - {question}.id = {qtype_essay_options}.questionid)"); - - // Essay savepoint reached. - upgrade_plugin_savepoint(true, 2013011800, 'qtype', 'essay'); - } - - if ($oldversion < 2013021700) { - // Create new fields responsetemplate and responsetemplateformat in qtyep_essay_options table. - $table = new xmldb_table('qtype_essay_options'); - $field = new xmldb_field('responsetemplate', XMLDB_TYPE_TEXT, null, null, - null, null, null, 'graderinfoformat'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - $field = new xmldb_field('responsetemplateformat', XMLDB_TYPE_INTEGER, '4', - null, XMLDB_NOTNULL, null, '0', 'responsetemplate'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - $DB->execute("UPDATE {qtype_essay_options} SET responsetemplate = '', - responsetemplateformat = " . FORMAT_HTML . " WHERE responsetemplate IS NULL"); - - // Essay savepoint reached. - upgrade_plugin_savepoint(true, 2013021700, 'qtype', 'essay'); - } - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2014011300) { - - // Create new field responserequired (indicates whether inline response is required). - - $table = new xmldb_table('qtype_essay_options'); - $field = new xmldb_field('responserequired', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '1', 'responseformat'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Essay savepoint reached. - upgrade_plugin_savepoint(true, 2014011300, 'qtype', 'essay'); - } - - if ($oldversion < 2014011301) { - - // Create new field attachmentsrequired (indicates whether attachments should be required). - - $table = new xmldb_table('qtype_essay_options'); - $field = new xmldb_field('attachmentsrequired', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'attachments'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Essay savepoint reached. - upgrade_plugin_savepoint(true, 2014011301, 'qtype', 'essay'); - } - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. @@ -185,33 +43,3 @@ function xmldb_qtype_essay_upgrade($oldversion) { return true; } - -/** - * Convert some content to HTML. - * @param string $text the content to convert to HTML - * @param int $oldformat One of the FORMAT_... constants. - */ -function qtype_essay_convert_to_html($text, $oldformat) { - switch ($oldformat) { - // Similar to format_text. - - case FORMAT_PLAIN: - $text = s($text); - $text = str_replace(' ', ' ', $text); - $text = nl2br($text); - return $text; - - case FORMAT_MARKDOWN: - return markdown_to_html($text); - - case FORMAT_MOODLE: - return text_to_html($text); - - case FORMAT_HTML: - return $text; - - default: - throw new coding_exception( - 'Unexpected text format when upgrading essay questions.'); - } -} diff --git a/question/type/match/db/upgrade.php b/question/type/match/db/upgrade.php index e2f10042e40..0254001ddc7 100644 --- a/question/type/match/db/upgrade.php +++ b/question/type/match/db/upgrade.php @@ -22,190 +22,14 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Upgrade code for the matching question type. * @param int $oldversion the version we are upgrading from. */ function xmldb_qtype_match_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - // Moodle v2.2.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.3.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.4.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2013012099) { - // Find duplicate rows before they break the 2013012103 step below. - $problemids = $DB->get_recordset_sql(" - SELECT question, MIN(id) AS recordidtokeep - FROM {question_match} - GROUP BY question - HAVING COUNT(1) > 1 - "); - foreach ($problemids as $problem) { - $DB->delete_records_select('question_match', - 'question = ? AND id > ?', - array($problem->question, $problem->recordidtokeep)); - } - $problemids->close(); - - // Shortanswer savepoint reached. - upgrade_plugin_savepoint(true, 2013012099, 'qtype', 'match'); - } - - if ($oldversion < 2013012100) { - - // Define table question_match to be renamed to qtype_match_options. - $table = new xmldb_table('question_match'); - - // Launch rename table for qtype_match_options. - $dbman->rename_table($table, 'qtype_match_options'); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012100, 'qtype', 'match'); - } - - if ($oldversion < 2013012101) { - - // Define key question (foreign) to be dropped form qtype_match_options. - $table = new xmldb_table('qtype_match_options'); - $key = new xmldb_key('question', XMLDB_KEY_FOREIGN, array('question'), 'question', array('id')); - - // Launch drop key question. - $dbman->drop_key($table, $key); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012101, 'qtype', 'match'); - } - - if ($oldversion < 2013012102) { - - // Rename field question on table qtype_match_options to questionid. - $table = new xmldb_table('qtype_match_options'); - $field = new xmldb_field('question', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'id'); - - // Launch rename field question. - $dbman->rename_field($table, $field, 'questionid'); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012102, 'qtype', 'match'); - } - - if ($oldversion < 2013012103) { - - // Define key questionid (foreign-unique) to be added to qtype_match_options. - $table = new xmldb_table('qtype_match_options'); - $key = new xmldb_key('questionid', XMLDB_KEY_FOREIGN_UNIQUE, array('questionid'), 'question', array('id')); - - // Launch add key questionid. - $dbman->add_key($table, $key); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012103, 'qtype', 'match'); - } - - if ($oldversion < 2013012104) { - - // Define field subquestions to be dropped from qtype_match_options. - $table = new xmldb_table('qtype_match_options'); - $field = new xmldb_field('subquestions'); - - // Conditionally launch drop field subquestions. - if ($dbman->field_exists($table, $field)) { - $dbman->drop_field($table, $field); - } - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012104, 'qtype', 'match'); - } - - if ($oldversion < 2013012105) { - - // Define table question_match_sub to be renamed to qtype_match_subquestions. - $table = new xmldb_table('question_match_sub'); - - // Launch rename table for qtype_match_subquestions. - $dbman->rename_table($table, 'qtype_match_subquestions'); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012105, 'qtype', 'match'); - } - - if ($oldversion < 2013012106) { - - // Define key question (foreign) to be dropped form qtype_match_subquestions. - $table = new xmldb_table('qtype_match_subquestions'); - $key = new xmldb_key('question', XMLDB_KEY_FOREIGN, array('question'), 'question', array('id')); - - // Launch drop key question. - $dbman->drop_key($table, $key); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012106, 'qtype', 'match'); - } - - if ($oldversion < 2013012107) { - - // Rename field question on table qtype_match_subquestions to questionid. - $table = new xmldb_table('qtype_match_subquestions'); - $field = new xmldb_field('question', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'id'); - - // Launch rename field question. - $dbman->rename_field($table, $field, 'questionid'); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012107, 'qtype', 'match'); - } - - if ($oldversion < 2013012108) { - - // Define key questionid (foreign) to be added to qtype_match_subquestions. - $table = new xmldb_table('qtype_match_subquestions'); - $key = new xmldb_key('questionid', XMLDB_KEY_FOREIGN, array('questionid'), 'question', array('id')); - - // Launch add key questionid. - $dbman->add_key($table, $key); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012108, 'qtype', 'match'); - } - - if ($oldversion < 2013012109) { - - // Define field code to be dropped from qtype_match_subquestions. - // The field code has not been needed since the new question engine in - // Moodle 2.1. It should be safe to drop it now. - $table = new xmldb_table('qtype_match_subquestions'); - $field = new xmldb_field('code'); - - // Conditionally launch drop field code. - if ($dbman->field_exists($table, $field)) { - $dbman->drop_field($table, $field); - } - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013012109, 'qtype', 'match'); - } - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/multianswer/db/upgrade.php b/question/type/multianswer/db/upgrade.php index 0ea12ad5a20..25b67f89bf5 100644 --- a/question/type/multianswer/db/upgrade.php +++ b/question/type/multianswer/db/upgrade.php @@ -23,7 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); /** @@ -35,25 +34,6 @@ function xmldb_qtype_multianswer_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Moodle v2.2.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.3.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.4.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. - // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/multichoice/db/upgrade.php b/question/type/multichoice/db/upgrade.php index 4d99e12e209..e93815731a9 100644 --- a/question/type/multichoice/db/upgrade.php +++ b/question/type/multichoice/db/upgrade.php @@ -23,121 +23,14 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Upgrade code for the multiple choice question type. * @param int $oldversion the version we are upgrading from. */ function xmldb_qtype_multichoice_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - // Moodle v2.2.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.3.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.4.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2013092300) { - // Find duplicate rows before they break the 2013092304 step below. - $problemids = $DB->get_recordset_sql(" - SELECT question, MIN(id) AS recordidtokeep - FROM {question_multichoice} - GROUP BY question - HAVING COUNT(1) > 1 - "); - foreach ($problemids as $problem) { - $DB->delete_records_select('question_multichoice', - 'question = ? AND id > ?', - array($problem->question, $problem->recordidtokeep)); - } - $problemids->close(); - - // Shortanswer savepoint reached. - upgrade_plugin_savepoint(true, 2013092300, 'qtype', 'multichoice'); - } - - if ($oldversion < 2013092301) { - - // Define table question_multichoice to be renamed to qtype_multichoice_options. - $table = new xmldb_table('question_multichoice'); - - // Launch rename table for question_multichoice. - $dbman->rename_table($table, 'qtype_multichoice_options'); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013092301, 'qtype', 'multichoice'); - } - - if ($oldversion < 2013092302) { - - // Define key question (foreign) to be dropped form qtype_multichoice_options. - $table = new xmldb_table('qtype_multichoice_options'); - $key = new xmldb_key('question', XMLDB_KEY_FOREIGN, array('question'), 'question', array('id')); - - // Launch drop key question. - $dbman->drop_key($table, $key); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013092302, 'qtype', 'multichoice'); - } - - if ($oldversion < 2013092303) { - - // Rename field question on table qtype_multichoice_options to questionid. - $table = new xmldb_table('qtype_multichoice_options'); - $field = new xmldb_field('question', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'id'); - - // Launch rename field question. - $dbman->rename_field($table, $field, 'questionid'); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013092303, 'qtype', 'multichoice'); - } - - if ($oldversion < 2013092304) { - - // Define key questionid (foreign-unique) to be added to qtype_multichoice_options. - $table = new xmldb_table('qtype_multichoice_options'); - $key = new xmldb_key('questionid', XMLDB_KEY_FOREIGN_UNIQUE, array('questionid'), 'question', array('id')); - - // Launch add key questionid. - $dbman->add_key($table, $key); - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013092304, 'qtype', 'multichoice'); - } - - if ($oldversion < 2013092305) { - - // Define field answers to be dropped from qtype_multichoice_options. - $table = new xmldb_table('qtype_multichoice_options'); - $field = new xmldb_field('answers'); - - // Conditionally launch drop field answers. - if ($dbman->field_exists($table, $field)) { - $dbman->drop_field($table, $field); - } - - // Record that qtype_match savepoint was reached. - upgrade_plugin_savepoint(true, 2013092305, 'qtype', 'multichoice'); - } - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/numerical/db/upgrade.php b/question/type/numerical/db/upgrade.php index c13ded84895..20f8ea9c6a3 100644 --- a/question/type/numerical/db/upgrade.php +++ b/question/type/numerical/db/upgrade.php @@ -23,34 +23,14 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Upgrade code for the numerical question type. * @param int $oldversion the version we are upgrading from. */ function xmldb_qtype_numerical_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - // Moodle v2.3.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.4.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/random/db/upgrade.php b/question/type/random/db/upgrade.php index f88efa9d414..4d354095afa 100644 --- a/question/type/random/db/upgrade.php +++ b/question/type/random/db/upgrade.php @@ -22,10 +22,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Upgrade code for the random question type. * @param int $oldversion the version we are upgrading from. @@ -33,26 +31,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_random_upgrade($oldversion) { global $CFG, $DB; - $dbman = $DB->get_manager(); - - // Moodle v2.2.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.3.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.4.0 release upgrade line - // Put any upgrade step following this. - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2014060200) { $sql = "UPDATE {question} SET questiontext = '0' diff --git a/question/type/randomsamatch/db/upgrade.php b/question/type/randomsamatch/db/upgrade.php index decbd36e4e8..890b2bf8362 100644 --- a/question/type/randomsamatch/db/upgrade.php +++ b/question/type/randomsamatch/db/upgrade.php @@ -22,173 +22,14 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Upgrade code for the random short answer matching question type. * @param int $oldversion the version we are upgrading from. */ function xmldb_qtype_randomsamatch_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - // Moodle v2.2.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.3.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.4.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2013110501) { - - // Define table question_randomsamatch to be renamed to qtype_randomsamatch_options. - $table = new xmldb_table('question_randomsamatch'); - - // Launch rename table for qtype_randomsamatch_options. - if ($dbman->table_exists($table)) { - $dbman->rename_table($table, 'qtype_randomsamatch_options'); - } - - // Record that qtype_randomsamatch savepoint was reached. - upgrade_plugin_savepoint(true, 2013110501, 'qtype', 'randomsamatch'); - } - - if ($oldversion < 2013110502) { - - // Define key question (foreign) to be dropped form qtype_randomsamatch_options. - $table = new xmldb_table('qtype_randomsamatch_options'); - $field = new xmldb_field('question', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'id'); - - if ($dbman->field_exists($table, $field)) { - // Launch drop key question. - $key = new xmldb_key('question', XMLDB_KEY_FOREIGN, array('question'), 'question', array('id')); - $dbman->drop_key($table, $key); - - // Launch rename field question. - $dbman->rename_field($table, $field, 'questionid'); - - $key = new xmldb_key('questionid', XMLDB_KEY_FOREIGN_UNIQUE, array('questionid'), 'question', array('id')); - // Launch add key questionid. - $dbman->add_key($table, $key); - } - - // Record that qtype_randomsamatch savepoint was reached. - upgrade_plugin_savepoint(true, 2013110502, 'qtype', 'randomsamatch'); - } - - if ($oldversion < 2013110503) { - - // Add subcats field. - $table = new xmldb_table('qtype_randomsamatch_options'); - - // Define field subcats to be added to qtype_randomsamatch_options. - $field = new xmldb_field('subcats', XMLDB_TYPE_INTEGER, 2, null, - XMLDB_NOTNULL, null, '1', 'choose'); - - // Conditionally launch add field subcats. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Add combined feedback fields. - // Define field correctfeedback to be added to qtype_randomsamatch_options. - $field = new xmldb_field('correctfeedback', XMLDB_TYPE_TEXT, 'small', null, - null, null, null, 'subcats'); - - // Conditionally launch add field correctfeedback. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - - // Now fill it with ''. - $DB->set_field('qtype_randomsamatch_options', 'correctfeedback', ''); - - // Now add the not null constraint. - $field = new xmldb_field('correctfeedback', XMLDB_TYPE_TEXT, 'small', null, - XMLDB_NOTNULL, null, null, 'subcats'); - $dbman->change_field_notnull($table, $field); - } - - // Define field correctfeedbackformat to be added to qtype_randomsamatch_options. - $field = new xmldb_field('correctfeedbackformat', XMLDB_TYPE_INTEGER, '2', null, - XMLDB_NOTNULL, null, '0', 'correctfeedback'); - - // Conditionally launch add field correctfeedbackformat. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Define field partiallycorrectfeedback to be added to qtype_randomsamatch_options. - $field = new xmldb_field('partiallycorrectfeedback', XMLDB_TYPE_TEXT, 'small', null, - null, null, null, 'correctfeedbackformat'); - - // Conditionally launch add field partiallycorrectfeedback. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - - // Now fill it with ''. - $DB->set_field('qtype_randomsamatch_options', 'partiallycorrectfeedback', ''); - - // Now add the not null constraint. - $field = new xmldb_field('partiallycorrectfeedback', XMLDB_TYPE_TEXT, 'small', null, - XMLDB_NOTNULL, null, null, 'correctfeedbackformat'); - $dbman->change_field_notnull($table, $field); - } - - // Define field partiallycorrectfeedbackformat to be added to qtype_randomsamatch_options. - $field = new xmldb_field('partiallycorrectfeedbackformat', XMLDB_TYPE_INTEGER, '2', null, - XMLDB_NOTNULL, null, '0', 'partiallycorrectfeedback'); - - // Conditionally launch add field partiallycorrectfeedbackformat. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Define field incorrectfeedback to be added to qtype_randomsamatch_options. - $field = new xmldb_field('incorrectfeedback', XMLDB_TYPE_TEXT, 'small', null, - null, null, null, 'partiallycorrectfeedbackformat'); - - // Conditionally launch add field incorrectfeedback. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - - // Now fill it with ''. - $DB->set_field('qtype_randomsamatch_options', 'incorrectfeedback', ''); - - // Now add the not null constraint. - $field = new xmldb_field('incorrectfeedback', XMLDB_TYPE_TEXT, 'small', null, - XMLDB_NOTNULL, null, null, 'partiallycorrectfeedbackformat'); - $dbman->change_field_notnull($table, $field); - } - - // Define field incorrectfeedbackformat to be added to qtype_randomsamatch_options. - $field = new xmldb_field('incorrectfeedbackformat', XMLDB_TYPE_INTEGER, '2', null, - XMLDB_NOTNULL, null, '0', 'incorrectfeedback'); - - // Conditionally launch add field incorrectfeedbackformat. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Define field shownumcorrect to be added to qtype_randomsamatch_options. - $field = new xmldb_field('shownumcorrect', XMLDB_TYPE_INTEGER, '2', null, - XMLDB_NOTNULL, null, '0', 'incorrectfeedbackformat'); - - // Conditionally launch add field shownumcorrect. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Record that qtype_randomsamatch savepoint was reached. - upgrade_plugin_savepoint(true, 2013110503, 'qtype', 'randomsamatch'); - } - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/shortanswer/db/upgrade.php b/question/type/shortanswer/db/upgrade.php index 0d330048f94..e605fc83a05 100644 --- a/question/type/shortanswer/db/upgrade.php +++ b/question/type/shortanswer/db/upgrade.php @@ -23,116 +23,14 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - defined('MOODLE_INTERNAL') || die(); - /** * Upgrade code for the essay question type. * @param int $oldversion the version we are upgrading from. */ function xmldb_qtype_shortanswer_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - // Moodle v2.4.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2013011799) { - // Find duplicate rows before they break the 2013011803 step below. - $problemids = $DB->get_recordset_sql(" - SELECT question, MIN(id) AS recordidtokeep - FROM {question_shortanswer} - GROUP BY question - HAVING COUNT(1) > 1 - "); - foreach ($problemids as $problem) { - $DB->delete_records_select('question_shortanswer', - 'question = ? AND id > ?', - array($problem->question, $problem->recordidtokeep)); - } - $problemids->close(); - - // Shortanswer savepoint reached. - upgrade_plugin_savepoint(true, 2013011799, 'qtype', 'shortanswer'); - } - - if ($oldversion < 2013011800) { - - // Define field answers to be dropped from question_shortanswer. - $table = new xmldb_table('question_shortanswer'); - $field = new xmldb_field('answers'); - - // Conditionally launch drop field answers. - if ($dbman->field_exists($table, $field)) { - $dbman->drop_field($table, $field); - } - - // Shortanswer savepoint reached. - upgrade_plugin_savepoint(true, 2013011800, 'qtype', 'shortanswer'); - } - - if ($oldversion < 2013011801) { - - // Define key question (foreign) to be dropped form question_shortanswer. - $table = new xmldb_table('question_shortanswer'); - $key = new xmldb_key('question', XMLDB_KEY_FOREIGN, array('question'), 'question', array('id')); - - // Launch drop key question. - $dbman->drop_key($table, $key); - - // Shortanswer savepoint reached. - upgrade_plugin_savepoint(true, 2013011801, 'qtype', 'shortanswer'); - } - - if ($oldversion < 2013011802) { - - // Rename field question on table question_shortanswer to questionid. - $table = new xmldb_table('question_shortanswer'); - $field = new xmldb_field('question', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'id'); - - // Launch rename field question. - $dbman->rename_field($table, $field, 'questionid'); - - // Shortanswer savepoint reached. - upgrade_plugin_savepoint(true, 2013011802, 'qtype', 'shortanswer'); - } - - if ($oldversion < 2013011803) { - - // Define key questionid (foreign-unique) to be added to question_shortanswer. - $table = new xmldb_table('question_shortanswer'); - $key = new xmldb_key('questionid', XMLDB_KEY_FOREIGN_UNIQUE, array('questionid'), 'question', array('id')); - - // Launch add key questionid. - $dbman->add_key($table, $key); - - // Shortanswer savepoint reached. - upgrade_plugin_savepoint(true, 2013011803, 'qtype', 'shortanswer'); - } - - if ($oldversion < 2013011804) { - - // Define table qtype_shortanswer_options to be renamed to qtype_shortanswer_options. - $table = new xmldb_table('question_shortanswer'); - - // Launch rename table for qtype_shortanswer_options. - $dbman->rename_table($table, 'qtype_shortanswer_options'); - - // Shortanswer savepoint reached. - upgrade_plugin_savepoint(true, 2013011804, 'qtype', 'shortanswer'); - } - - // Moodle v2.5.0 release upgrade line. - // Put any upgrade step following this. - - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/upgrade.txt b/question/type/upgrade.txt index 2cd5513fcbb..470629c4b26 100644 --- a/question/type/upgrade.txt +++ b/question/type/upgrade.txt @@ -1,5 +1,11 @@ This files describes API changes for question type plugins. +=== 3.1 === + +* The following functions, previously used (exclusively) by upgrade steps are not available + anymore because of the upgrade cleanup performed for this version. See MDL-51580 for more info: + - qtype_essay_convert_to_html() + === 2.7 === + We have added a new method to the question_type base class 'break_down_stats_and_response_analysis_by_variant'. By default it returns true. If your question type does not have variants of question instances then you can ignore this method as it only diff --git a/repository/alfresco/db/upgrade.php b/repository/alfresco/db/upgrade.php index 7046b1e1ac8..3b4f45ffd66 100644 --- a/repository/alfresco/db/upgrade.php +++ b/repository/alfresco/db/upgrade.php @@ -31,30 +31,7 @@ defined('MOODLE_INTERNAL') || die(); * @return bool result */ function xmldb_repository_alfresco_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - if ($oldversion < 2014020301) { - require_once($CFG->dirroot . '/repository/lib.php'); - require_once($CFG->dirroot . '/repository/alfresco/db/upgradelib.php'); - - $params = array(); - $params['context'] = array(); - $params['onlyvisible'] = false; - $params['type'] = 'alfresco'; - $instances = repository::get_instances($params); - - // Notify the admin about the migration process if they are using the repo. - if (!empty($instances)) { - repository_alfresco_admin_security_key_notice(); - } - - upgrade_plugin_savepoint(true, 2014020301, 'repository', 'alfresco'); - } - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. diff --git a/repository/alfresco/db/upgradelib.php b/repository/alfresco/db/upgradelib.php deleted file mode 100644 index 1a363e68542..00000000000 --- a/repository/alfresco/db/upgradelib.php +++ /dev/null @@ -1,53 +0,0 @@ -. - -/** - * Locallib. - * - * @package repository_alfresco - * @copyright 2014 Frédéric Massart - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -/** - * Send a message to the admin in regard with the APIv1 migration. - * - * @return void - */ -function repository_alfresco_admin_security_key_notice() { - $admins = get_admins(); - - if (empty($admins)) { - return; - } - - foreach ($admins as $admin) { - $message = new stdClass(); - $message->component = 'moodle'; - $message->name = 'notices'; - $message->userfrom = get_admin(); - $message->userto = $admin; - $message->smallmessage = get_string('security_key_notice_message_small', 'repository_alfresco'); - $message->subject = get_string('security_key_notice_message_subject', 'repository_alfresco'); - $message->fullmessage = get_string('security_key_notice_message_content', 'repository_alfresco'); - $message->fullmessagehtml = get_string('security_key_notice_message_content', 'repository_alfresco'); - $message->fullmessageformat = FORMAT_PLAIN; - $message->notification = 1; - message_send($message); - } -} diff --git a/repository/alfresco/lang/en/repository_alfresco.php b/repository/alfresco/lang/en/repository_alfresco.php index 1bcc0e0c981..481040dadb9 100644 --- a/repository/alfresco/lang/en/repository_alfresco.php +++ b/repository/alfresco/lang/en/repository_alfresco.php @@ -31,9 +31,6 @@ $string['notitle'] = 'notitle'; $string['password'] = 'Password'; $string['pluginname_help'] = 'A plug-in for Alfresco CMS'; $string['pluginname'] = 'Alfresco repository'; -$string['security_key_notice_message_small'] = 'Due to a recent security issue found in the Alfresco repository, we advice you to restart your Alfresco server.'; -$string['security_key_notice_message_subject'] = 'Alfresco repository security notice'; -$string['security_key_notice_message_content'] = 'A recent security issue was discovered when using external links to the Alfresco Moodle repository. Users were able to gain access to the accounts of other users on the Alfresco server through the use of information contained in these links (tokens). This feature has now been disabled, but it is possible that the tokens contained within these links still allow access to another user\'s account. For your own protection, it is important that you restart your Alfresco server in order to expire the tokens.'; $string['soapmustbeenabled'] = 'SOAP extension must be enabled for alfresco plugin'; $string['space'] = 'Space'; $string['username'] = 'User name'; diff --git a/repository/boxnet/db/upgrade.php b/repository/boxnet/db/upgrade.php index a85a7504da4..774e637ad0d 100644 --- a/repository/boxnet/db/upgrade.php +++ b/repository/boxnet/db/upgrade.php @@ -31,51 +31,7 @@ defined('MOODLE_INTERNAL') || die(); * @return bool result */ function xmldb_repository_boxnet_upgrade($oldversion) { - global $CFG, $DB; - - $dbman = $DB->get_manager(); - - if ($oldversion < 2013110503) { - // Delete old user preferences containing auth tokens. - $DB->delete_records('user_preferences', array('name' => 'boxnet__auth_token')); - upgrade_plugin_savepoint(true, 2013110503, 'repository', 'boxnet'); - } - - if ($oldversion < 2013110700) { - require_once($CFG->dirroot . '/repository/lib.php'); - require_once($CFG->dirroot . '/repository/boxnet/db/upgradelib.php'); - - $clientid = get_config('boxnet', 'clientid'); - $clientsecret = get_config('boxnet', 'clientsecret'); - - // Only proceed if the repository hasn't been set for APIv2 yet. - if ($clientid === false && $clientsecret === false) { - $params = array(); - $params['context'] = array(); - $params['onlyvisible'] = false; - $params['type'] = 'boxnet'; - $instances = repository::get_instances($params); - - // Notify the admin about the migration process if they are using the repo. - if (!empty($instances)) { - repository_boxnet_admin_upgrade_notification(); - } - - // Hide the repository. - $repositorytype = repository::get_type_by_typename('boxnet'); - if (!empty($repositorytype)) { - $repositorytype->update_visibility(false); - } - } - - upgrade_plugin_savepoint(true, 2013110700, 'repository', 'boxnet'); - } - - // Moodle v2.6.0 release upgrade line. - // Put any upgrade step following this. - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. + global $CFG; // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this. diff --git a/repository/boxnet/db/upgradelib.php b/repository/boxnet/db/upgradelib.php deleted file mode 100644 index c0cf9de80d6..00000000000 --- a/repository/boxnet/db/upgradelib.php +++ /dev/null @@ -1,55 +0,0 @@ -. - -/** - * Locallib. - * - * @package repository_boxnet - * @copyright 2013 Frédéric Massart - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -/** - * Send a message to the admin in regard with the APIv1 migration. - * - * @return void - */ -function repository_boxnet_admin_upgrade_notification() { - $admins = get_admins(); - - if (empty($admins)) { - return; - } - $a = new stdClass(); - $a->docsurl = get_docs_url('Box.net_APIv1_migration'); - - foreach ($admins as $admin) { - $message = new stdClass(); - $message->component = 'moodle'; - $message->name = 'notices'; - $message->userfrom = get_admin(); - $message->userto = $admin; - $message->smallmessage = get_string('apiv1migration_message_small', 'repository_boxnet'); - $message->subject = get_string('apiv1migration_message_subject', 'repository_boxnet'); - $message->fullmessage = get_string('apiv1migration_message_content', 'repository_boxnet', $a); - $message->fullmessagehtml = get_string('apiv1migration_message_content', 'repository_boxnet', $a); - $message->fullmessageformat = FORMAT_PLAIN; - $message->notification = 1; - message_send($message); - } -} diff --git a/repository/boxnet/lang/en/repository_boxnet.php b/repository/boxnet/lang/en/repository_boxnet.php index 59e602909a4..e64ebff4845 100644 --- a/repository/boxnet/lang/en/repository_boxnet.php +++ b/repository/boxnet/lang/en/repository_boxnet.php @@ -24,9 +24,6 @@ */ $string['apikey'] = 'API key'; -$string['apiv1migration_message_content'] = 'As part of the recent Moodle upgrade (2.6, 2.5.3, 2.4.7), the Box repository plugin has been disabled. To re-enable it, you need to re-configure it as described in the documentation {$a->docsurl}.'; -$string['apiv1migration_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Box APIv1 migration.'; -$string['apiv1migration_message_subject'] = 'Important information regarding Box repository plugin'; $string['boxnet:view'] = 'View Box repository'; $string['cannotcreatereference'] = 'Cannot create a reference, not enough permissions to share the file on Box.'; $string['clientid'] = 'Client ID'; diff --git a/repository/dropbox/db/upgrade.php b/repository/dropbox/db/upgrade.php index c51ea5c114b..3e25c1f5257 100644 --- a/repository/dropbox/db/upgrade.php +++ b/repository/dropbox/db/upgrade.php @@ -14,40 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, seeTo use this plugin, you must register your site with Google, as described in the documentation Google OAuth 2.0 setup.
As part of the registration process, you will need to enter the following URL as \'Authorized Redirect URIs\':
{$a->callbackurl}
Once registered, you will be provided with a client ID and secret which can be used to configure all Google Drive and Picasa plugins.
Please also note that you will have to enable the service \'Drive API\'.
'; -$string['oauth2upgrade_message_subject'] = 'Important information regarding Google Drive repository plugin'; -$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Google Drive portfolio plugin has been disabled. To re-enable it, your Moodle site needs to be registered with Google, as described in the documentation {$a->docsurl}, in order to obtain a client ID and secret. The client ID and secret can then be used to configure all Google Drive and Picasa plugins.'; -$string['oauth2upgrade_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Google OAuth 2.0 setup.'; $string['pluginname'] = 'Google Drive'; $string['secret'] = 'Secret'; $string['servicenotenabled'] = 'Access not configured. Make sure the service \'Drive API\' is enabled.'; diff --git a/repository/picasa/db/upgrade.php b/repository/picasa/db/upgrade.php index 2853786cdd0..ec2fe8afc48 100644 --- a/repository/picasa/db/upgrade.php +++ b/repository/picasa/db/upgrade.php @@ -14,52 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, seeTo use this plugin, you must register your site with Google, as described in the documentation Google OAuth 2.0 setup.
As part of the registration process, you will need to enter the following URL as \'Authorized Redirect URIs\':
{$a->callbackurl}
Once registered, you will be provided with a client ID and secret which can be used to configure all Google Drive and Picasa plugins.
'; -$string['oauth2upgrade_message_subject'] = 'Important information regarding Picasa repository plugin'; -$string['oauth2upgrade_message_content'] = 'As part of the upgrade to Moodle 2.3, the Picasa portfolio plugin has been disabled. To re-enable it, your Moodle site needs to be registered with Google, as described in the documentation {$a->docsurl}, in order to obtain a client ID and secret. The client ID and secret can then be used to configure all Google Drive and Picasa plugins.'; -$string['oauth2upgrade_message_small'] = 'This plugin has been disabled, as it requires configuration as described in the documentation Google OAuth 2.0 setup.'; $string['picasa:view'] = 'View picasa repository'; $string['pluginname'] = 'Picasa web album'; $string['secret'] = 'Secret'; diff --git a/repository/upgrade.txt b/repository/upgrade.txt index e47ba3be344..e190f817c8b 100644 --- a/repository/upgrade.txt +++ b/repository/upgrade.txt @@ -3,6 +3,15 @@ information provided here is intended especially for developers. Full details of the repository API are available on Moodle docs: http://docs.moodle.org/dev/Repository_API +=== 3.1 === + +* The following functions, previously used (exclusively) by upgrade steps are not available + anymore because of the upgrade cleanup performed for this version. See MDL-51580 for more info: + - repository_picasa_admin_upgrade_notification() + - repository_googledocs_admin_upgrade_notification() + - repository_boxnet_admin_upgrade_notification() + - repository_alfresco_admin_security_key_notice() + === 2.8 === * Repositories working with Moodle files must replace serialize() with json_encode() in the diff --git a/theme/more/db/upgrade.php b/theme/more/db/upgrade.php index e9d043d3636..aa97060a713 100644 --- a/theme/more/db/upgrade.php +++ b/theme/more/db/upgrade.php @@ -33,46 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_theme_more_upgrade($oldversion) { global $CFG; - if ($oldversion < 2014032400) { - - // Set the default background. If an image is already there then ignore. - $fs = get_file_storage(); - $bg = $fs->get_area_files(context_system::instance()->id, 'theme_more', 'backgroundimage', 0); - - // Add default background image. - if (empty($bg)) { - $filerecord = new stdClass(); - $filerecord->component = 'theme_more'; - $filerecord->contextid = context_system::instance()->id; - $filerecord->userid = get_admin()->id; - $filerecord->filearea = 'backgroundimage'; - $filerecord->filepath = '/'; - $filerecord->itemid = 0; - $filerecord->filename = 'background.jpg'; - $fs->create_file_from_pathname($filerecord, $CFG->dirroot . '/theme/more/pix/background.jpg'); - } - - upgrade_plugin_savepoint(true, 2014032400, 'theme', 'more'); - - } - - if ($oldversion < 2014032401) { - - // Set the default settings as they might already be set. - set_config('textcolor', '#333366', 'theme_more'); - set_config('linkcolor', '#FF6500', 'theme_more'); - set_config('backgroundrepeat', 'repeat', 'theme_more'); - set_config('contentbackground', '#FFFFFF', 'theme_more'); - set_config('secondarybackground', '#FFFFFF', 'theme_more'); - set_config('invert', 1, 'theme_more'); - set_config('backgroundimage', '/background.jpg', 'theme_more'); - - upgrade_plugin_savepoint(true, 2014032401, 'theme', 'more'); - } - - // Moodle v2.7.0 release upgrade line. - // Put any upgrade step following this. - // Moodle v2.8.0 release upgrade line. // Put any upgrade step following this.