Skip to content

Commit

Permalink
MDL-24090 new detection of plugins that were not upgraded to work wit…
Browse files Browse the repository at this point in the history
…h Moodle 2.x (uses $plugin->requires) + bumping ancient versions of plugins
  • Loading branch information
skodak committed Sep 5, 2010
1 parent d32fb55 commit ef14c1e
Show file tree
Hide file tree
Showing 49 changed files with 106 additions and 93 deletions.
4 changes: 2 additions & 2 deletions admin/report/courseoverview/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2007101503;
$plugin->requires = 2007101532;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
4 changes: 2 additions & 2 deletions admin/report/questioninstances/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2007101502;
$plugin->requires = 2007101532;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
4 changes: 2 additions & 2 deletions admin/report/security/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2008122900;
$plugin->requires = 2008121701;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
4 changes: 2 additions & 2 deletions admin/report/unittest/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2008112601;
$plugin->requires = 2008112600;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;

3 changes: 2 additions & 1 deletion blocks/tags/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2008063001;
$plugin->version = 2010090502;
$plugin->requires = 2010090501;
4 changes: 2 additions & 2 deletions course/report/completion/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2007101501;
$plugin->requires = 2007101532;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
4 changes: 2 additions & 2 deletions course/report/log/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2007101504;
$plugin->requires = 2007101532;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions course/report/outline/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2007101501;
$plugin->requires = 2007101532;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions course/report/participation/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2007101501;
$plugin->requires = 2007101532;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions course/report/progress/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2007101500;
$plugin->requires = 2007101532;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions course/report/stats/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$plugin->version = 2007101501;
$plugin->requires = 2007101532;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


2 changes: 1 addition & 1 deletion enrol/authorize/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
defined('MOODLE_INTERNAL') || die();

$plugin->version = 2010081203;
$plugin->requires = 2007101507;
$plugin->requires = 2010090501;
$plugin->cron = 180;
2 changes: 1 addition & 1 deletion enrol/paypal/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
defined('MOODLE_INTERNAL') || die();

$plugin->version = 2010073100;
$plugin->requires = 2007101000; // Requires this Moodle version
$plugin->requires = 2010090501; // Requires this Moodle version
4 changes: 2 additions & 2 deletions grade/export/ods/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007092701;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/export/txt/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007092700;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/export/xls/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007092700;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/export/xml/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007092700;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/import/csv/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007072500;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/import/xml/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007092700;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/report/grader/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2009022500;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/report/outcomes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007073000;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/report/overview/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2009022500;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions grade/report/user/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007092500;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions lib/editor/textarea/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2009051400;
$plugin->requires = 2009051200;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
12 changes: 12 additions & 0 deletions lib/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ function upgrade_plugins($type, $startcallback, $endcallback, $verbose) {
if (!empty($plugin->requires)) {
if ($plugin->requires > $CFG->version) {
throw new upgrade_requires_exception($component, $plugin->version, $CFG->version, $plugin->requires);
} else if ($plugin->requires < 2010000000) {
throw new plugin_defective_exception($component, 'Plugin is not compatible with Moodle 2.x or later.');
}
}

Expand Down Expand Up @@ -419,6 +421,8 @@ function upgrade_plugins_modules($startcallback, $endcallback, $verbose) {
if (!empty($module->requires)) {
if ($module->requires > $CFG->version) {
throw new upgrade_requires_exception($component, $module->version, $CFG->version, $module->requires);
} else if ($module->requires < 2010000000) {
throw new plugin_defective_exception($component, 'Plugin is not compatible with Moodle 2.x or later.');
}
}

Expand Down Expand Up @@ -553,6 +557,14 @@ function upgrade_plugins_blocks($startcallback, $endcallback, $verbose) {
include($fullblock.'/version.php');
$block = $plugin;

if (!empty($plugin->requires)) {
if ($plugin->requires > $CFG->version) {
throw new upgrade_requires_exception($component, $plugin->version, $CFG->version, $plugin->requires);
} else if ($plugin->requires < 2010000000) {
throw new plugin_defective_exception($component, 'Plugin is not compatible with Moodle 2.x or later.');
}
}

if (!is_readable($fullblock.'/block_'.$blockname.'.php')) {
throw new plugin_defective_exception('block/'.$blockname, 'Missing main block class file.');
}
Expand Down
4 changes: 2 additions & 2 deletions message/output/email/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/


$plugin->version = 2008072401;
$plugin->requires = 2008072401;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions message/output/jabber/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @package
*/

$plugin->version = 2008090900;
$plugin->requires = 2008091500;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions message/output/popup/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @package
*/

$plugin->version = 2008072401;
$plugin->requires = 2008072401;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions mod/assignment/type/online/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////

$plugin->version = 2005042900;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;


4 changes: 2 additions & 2 deletions mod/workshop/eval/best/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2009103000;
$plugin->requires = 2009100605; // Requires this Moodle version
$plugin->version = 2010090501;
$plugin->requires = 2010090501; // Requires this Moodle version
4 changes: 2 additions & 2 deletions mod/workshop/form/accumulative/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2009103000;
$plugin->requires = 2009080700; // Requires this Moodle version
$plugin->version = 2010090501;
$plugin->requires = 2010090501; // Requires this Moodle version
4 changes: 2 additions & 2 deletions mod/workshop/form/comments/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2009103000;
$plugin->requires = 2009102600; // Requires this Moodle version
$plugin->version = 2010090501;
$plugin->requires = 2010090501; // Requires this Moodle version
4 changes: 2 additions & 2 deletions mod/workshop/form/numerrors/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2009103000;
$plugin->requires = 2009080700; // Requires this Moodle version
$plugin->version = 2010090501;
$plugin->requires = 2010090501; // Requires this Moodle version
4 changes: 2 additions & 2 deletions mod/workshop/form/rubric/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2009103000;
$plugin->requires = 2009100600; // Requires this Moodle version
$plugin->version = 2010090501;
$plugin->requires = 2010090501; // Requires this Moodle version
4 changes: 2 additions & 2 deletions portfolio/boxnet/version.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

$plugin->version = 2008072500;
$plugin->requires = 2008072500;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
$plugin->cron = 0;


4 changes: 2 additions & 2 deletions portfolio/download/version.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

$plugin->version = 2008072500;
$plugin->requires = 2008072500;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
$plugin->cron = 0;


4 changes: 2 additions & 2 deletions portfolio/flickr/version.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

$plugin->version = 2008072500;
$plugin->requires = 2008072500;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
$plugin->cron = 0;


4 changes: 2 additions & 2 deletions portfolio/googledocs/version.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$plugin->version = 2008072505;
$plugin->requires = 2008072500;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
$plugin->cron = 0;

4 changes: 2 additions & 2 deletions portfolio/mahara/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$plugin->version = 2010021800;
$plugin->requires = 2008072500;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
$plugin->cron = 0;


4 changes: 2 additions & 2 deletions portfolio/picasa/version.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

$plugin->version = 2008072505;
$plugin->requires = 2008072500;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;
$plugin->cron = 0;


4 changes: 2 additions & 2 deletions question/type/calculated/version.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?PHP

$plugin->version = 2010020801;
$plugin->requires = 2007101000;
$plugin->version = 2010090501;
$plugin->requires = 2010090501;

Loading

0 comments on commit ef14c1e

Please sign in to comment.