diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php
index 390bc91188f..37705db105e 100644
--- a/lang/en_utf8/admin.php
+++ b/lang/en_utf8/admin.php
@@ -494,8 +494,6 @@ $string['rcachettl'] = 'Record cache TTL';
$string['releasenoteslink'] = 'For information about this version of Moodle, please see the online Release Notes';
$string['remotelangnotavailable'] = 'Because Moodle can not connect to download.moodle.org, we are unable to do language pack installation automatically. Please download the appropriate zip file(s) from the list below, copy them to your $a directory and unzip them manually.';
$string['renameerrors'] = 'Errors in renames';
-$string['requiredentrieschanged'] = 'IMPORTANT - PLEASE READ
(This warning message will only be displayed during this upgrade)
Due to a bug fix, the behaviour of database activities using the \'Required entries\' and \'Required entries before viewing settings\' settings will change. A more detailed explaination of the changes can be read on the database module forum. The expected behavior of these settings can also be read on Moodle Docs.
-
This change affects the following databases in your system: (Please save this list now, and after the upgrade, check that these activities still work the way that the teacher intends.)
$a->text
';
$string['restrictbydefault'] = 'Restrict modules by default';
$string['restrictmodulesfor'] = 'Restrict modules for';
$string['riskconfig'] = 'Users could change site configuration and behaviour';
diff --git a/lang/en_utf8/data.php b/lang/en_utf8/data.php
index b71c98617a6..cc3592ea329 100644
--- a/lang/en_utf8/data.php
+++ b/lang/en_utf8/data.php
@@ -193,6 +193,8 @@ $string['recordsnotsaved'] = 'No entry was saved. Please check the format of the
$string['recordssaved'] = 'entries saved';
$string['requireapproval'] = 'Require approval?';
$string['requiredentries'] = 'Required entries';
+$string['requiredentrieschanged'] = 'IMPORTANT - PLEASE READ
Due to a bug fix, the behaviour of database activities using the \'Required entries\' and \'Required entries before viewing settings\' settings will change. A more detailed explaination of the changes can be read on the database module forum. The expected behavior of these settings can also be read on Moodle Docs.
+
This change affects the following databases in your system: (Please save this list now, and after the upgrade, check that these activities still work the way that the teacher intends.)
$a->text
';
$string['requiredentriestoview'] = 'Entries required before viewing';
$string['resettemplate'] = 'Reset template';
$string['resizingimages'] = 'Resizing image thumbnails...';
diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php
index 94c9754c9f4..b825b572fcd 100644
--- a/mod/data/db/upgrade.php
+++ b/mod/data/db/upgrade.php
@@ -44,6 +44,28 @@ function xmldb_data_upgrade($oldversion=0) {
}
+ ///Display a warning message about "Required Entries" fix from MDL-16999
+ if ($result && $oldversion < 2007022602) {
+ if (!get_config('data', 'requiredentriesfixflag')) {
+ set_config('requiredentriesfixflag', true, 'data'); // remove old flag
+
+ $databases = get_records_sql("SELECT d.*, c.fullname
+ FROM {$CFG->prefix}data d, {$CFG->prefix}course c
+ WHERE d.course = c.id
+ AND (d.requiredentries > 0 OR d.requiredentriestoview > 0)
+ ORDER BY c.fullname, d.name");
+ if (!empty($databases)) {
+ $a = new object();
+ $a->text = '';
+ foreach($databases as $database) {
+ $a->text .= "".$database->fullname." - " .$database->name. " (course id: ".$database->course." - database id: ".$database->id.")
";
+ }
+ notify(get_string('requiredentrieschanged', 'data', $a));
+ }
+ }
+ }
+
+
return $result;
}
diff --git a/mod/data/lib.php b/mod/data/lib.php
index d5cf8ffed80..2243b07b5c8 100755
--- a/mod/data/lib.php
+++ b/mod/data/lib.php
@@ -1879,40 +1879,4 @@ function data_preset_path($course, $userid, $shortname) {
return 'Does it disturb you that this code will never run?';
}
-/**
- * This function is called into environment.xml
- * Check if both of database required entries fields have been set for a version anterior to 2007021572
- * This check has been required by the bug MDL-16999
- * @global $CFG
- * @param $result
- * @return object status
- */
-function check_required_entries_fields($result) {
- global $CFG;
- if (!empty($CFG->version) //we are not installing a new Moodle site
- && $CFG->version < 2007021572 //the version is anterior to the one when the fix has been applied
- && !get_config("data","requiredentriesfixflag")) { //do not show message when upgrading an anterior version when the patch has already been applied
- set_config("requiredentriesfixflag",true, "data"); //set a flag into database in order to let know a Moodle 1.9 upgrade that the message has already been displayed
- $databases = get_records_sql("SELECT d.*, c.fullname
- FROM {$CFG->prefix}data d,
- {$CFG->prefix}course c
- WHERE d.course = c.id
- ORDER BY c.fullname, d.name");
- if (!empty($databases)) {
- $a = new object();
- foreach($databases as $database) {
- if ($database->requiredentries != 0 || $database->requiredentriestoview != 0) {
- $a->text .= "".$database->fullname." - " .$database->name. " (course id: ".$database->course." - database id: ".$database->id.")
";
- //set the feedback string here and not in xml file since we need something
- //more complex than just a string picked from admin.php lang file
- $result->setFeedbackStr(array('requiredentrieschanged', 'admin', $a));
- $result->setStatus(false);//fail test
- }
- }
- return $result;
- }
- }
- return null;
-}
-
?>
diff --git a/mod/data/version.php b/mod/data/version.php
index 1b8b588e103..a4e02c75655 100644
--- a/mod/data/version.php
+++ b/mod/data/version.php
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2007022601;
+$module->version = 2007022602;
$module->requires = 2007020200; // Requires this Moodle version
$module->cron = 60;