MDL-85660 format: Disable social course format

The social course format is now disabled by default for all new and
upgraded installations.
Existing courses using this format will continue to function, but
administrators must re-enable it to create new social courses.
This commit is contained in:
Sara Arjona
2025-08-26 18:03:54 +02:00
parent e3e51a0613
commit 9c4e1d7706
5 changed files with 57 additions and 7 deletions
@@ -0,0 +1,9 @@
issueNumber: MDL-85660
notes:
format_social:
- message: >-
The social course format is now disabled by default for all new and
upgraded installations. Existing courses using this format will continue
to function, but administrators must re-enable it to create new social
courses.
type: deprecated
+32
View File
@@ -0,0 +1,32 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Install script for format_social.
*
* @package format_social
* @copyright 2025 Sara Arjona <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Perform the post-install procedures.
*/
function xmldb_format_social_install() {
// Disable the Social course format on new installs by default.
$manager = \core_plugin_manager::resolve_plugininfo_class('format');
$manager::enable_plugin('social', 0);
}
-6
View File
@@ -236,9 +236,6 @@ class helper {
static::add_plugin($presetid, 'block', 'recentlyaccessedcourses', false);
static::add_plugin($presetid, 'block', 'starredcourses', false);
// Course formats: Disable Social format.
static::add_plugin($presetid, 'format', 'social', false);
// Data formats: Disable Javascript Object Notation (.json).
static::add_plugin($presetid, 'dataformat', 'json', false);
@@ -332,9 +329,6 @@ class helper {
static::add_plugin($presetid, 'block', 'recentlyaccessedcourses', true);
static::add_plugin($presetid, 'block', 'starredcourses', true);
// Course formats: Enable Social format.
static::add_plugin($presetid, 'format', 'social', true);
// Data formats: Enable Javascript Object Notation (.json).
static::add_plugin($presetid, 'dataformat', 'json', true);
+15
View File
@@ -2067,5 +2067,20 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2025081900.04);
}
if ($oldversion < 2025082600.01) {
if (get_config('moodlecourse', 'format') === 'social') {
// If the social course format is set as default, change it to topics.
set_config('format', 'topics', 'moodlecourse');
}
$DB->delete_records('adminpresets_plug', ['plugin' => 'format', 'name' => 'social']);
// Disable Social course format.
$manager = \core_plugin_manager::resolve_plugininfo_class('format');
$manager::enable_plugin('social', 0);
// Main savepoint reached.
upgrade_main_savepoint(true, 2025082600.01);
}
return true;
}
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2025082600.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2025082600.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '5.1dev+ (Build: 20250826)'; // Human-friendly version name