mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-74887 mod_label: Update visibility
This commit is contained in:
parent
c4523503d2
commit
1a772e6906
2 changed files with 15 additions and 2 deletions
|
@ -45,7 +45,7 @@
|
||||||
defined('MOODLE_INTERNAL') || die;
|
defined('MOODLE_INTERNAL') || die;
|
||||||
|
|
||||||
function xmldb_label_upgrade($oldversion) {
|
function xmldb_label_upgrade($oldversion) {
|
||||||
global $CFG;
|
global $CFG, $DB;
|
||||||
|
|
||||||
// Automatically generated Moodle v3.9.0 release upgrade line.
|
// Automatically generated Moodle v3.9.0 release upgrade line.
|
||||||
// Put any upgrade step following this.
|
// Put any upgrade step following this.
|
||||||
|
@ -53,5 +53,18 @@ function xmldb_label_upgrade($oldversion) {
|
||||||
// Automatically generated Moodle v4.0.0 release upgrade line.
|
// Automatically generated Moodle v4.0.0 release upgrade line.
|
||||||
// Put any upgrade step following this.
|
// Put any upgrade step following this.
|
||||||
|
|
||||||
|
if ($oldversion < 2022101300) {
|
||||||
|
$module = $DB->get_field('modules', 'id', ['name' => 'label']);
|
||||||
|
$DB->execute('
|
||||||
|
UPDATE {course_modules}
|
||||||
|
SET visible = 0, visibleoncoursepage = 1
|
||||||
|
WHERE module = :module
|
||||||
|
AND visible = 1
|
||||||
|
AND visibleoncoursepage = 0',
|
||||||
|
['module' => $module]
|
||||||
|
);
|
||||||
|
upgrade_mod_savepoint(true, 2022101300, 'label');
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$plugin->version = 2022041900; // The current module version (Date: YYYYMMDDXX).
|
$plugin->version = 2022101300; // The current module version (Date: YYYYMMDDXX).
|
||||||
$plugin->requires = 2022041200; // Requires this Moodle version.
|
$plugin->requires = 2022041200; // Requires this Moodle version.
|
||||||
$plugin->component = 'mod_label'; // Full name of the plugin (used for diagnostics)
|
$plugin->component = 'mod_label'; // Full name of the plugin (used for diagnostics)
|
||||||
$plugin->cron = 0;
|
$plugin->cron = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue