Merge branch 'MDL-85660-main' of https://github.com/sarjona/moodle
This commit is contained in:
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@ Feature: I can apply presets
|
||||
And I should see "Disable Restriction by grouping"
|
||||
And I navigate to "Plugins > Blocks > Manage blocks" in site administration
|
||||
And I should see "Disable Logged in user"
|
||||
And I navigate to "Plugins > Course formats > Manage course formats" in site administration
|
||||
And "Disable" "icon" should exist in the "Social" "table_row"
|
||||
And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration
|
||||
And "Enabled" "icon" should exist in the "Immediate feedback with CBM" "table_row"
|
||||
And I navigate to "Plugins > Question types > Manage question types" in site administration
|
||||
@@ -83,7 +81,6 @@ Feature: I can apply presets
|
||||
And I should see "Server files" in the "Setting changes" "table"
|
||||
And I should see "Show data retention summary" in the "Setting changes" "table"
|
||||
And I should see "Social activities" in the "Setting changes" "table"
|
||||
And I should see "Social" in the "Setting changes" "table"
|
||||
And I should see "Starred courses" in the "Setting changes" "table"
|
||||
And I should see "Lesson" in the "Setting changes" "table"
|
||||
And I should see "Tags" in the "Setting changes" "table"
|
||||
@@ -105,8 +102,6 @@ Feature: I can apply presets
|
||||
And I should see "Enable Restriction by grouping"
|
||||
And I navigate to "Plugins > Blocks > Manage blocks" in site administration
|
||||
And I should see "Enable Logged in user"
|
||||
And I navigate to "Plugins > Course formats > Manage course formats" in site administration
|
||||
And "Disable" "icon" should not exist in the "Social" "table_row"
|
||||
And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration
|
||||
And "Enabled" "icon" should not exist in the "Immediate feedback with CBM" "table_row"
|
||||
And I navigate to "Plugins > Question types > Manage question types" in site administration
|
||||
|
||||
@@ -4,7 +4,7 @@ Feature: I can revert changes after a load
|
||||
Background: Apply Starter Moodle to revert it
|
||||
Given I log in as "admin"
|
||||
And I navigate to "Site admin presets" in site administration
|
||||
And I press "Review settings and apply" action in the "Starter" report row
|
||||
And I press "Review settings and apply" action in the "Moodle with all of the most popular features" report row
|
||||
And I should see "Setting changes"
|
||||
And I click on "Apply" "button"
|
||||
And I click on "Continue" "button"
|
||||
@@ -24,14 +24,12 @@ Feature: I can revert changes after a load
|
||||
And I should see "Enable Restriction by grouping"
|
||||
And I navigate to "Plugins > Blocks > Manage blocks" in site administration
|
||||
And "Disable Logged in user" "icon" should not exist in the "Logged in user" "table_row"
|
||||
And I navigate to "Plugins > Course formats > Manage course formats" in site administration
|
||||
And "Disable" "icon" should not exist in the "Social" "table_row"
|
||||
And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration
|
||||
And "Enabled" "icon" should not exist in the "Immediate feedback with CBM" "table_row"
|
||||
And I navigate to "Plugins > Question types > Manage question types" in site administration
|
||||
And "Enabled" "icon" should not exist in the "Calculated multichoice" "table_row"
|
||||
And I navigate to "Site admin presets" in site administration
|
||||
And I press "Show version history" action in the "Starter" report row
|
||||
And I press "Show version history" action in the "Moodle with all of the most popular features" report row
|
||||
When I click on "Restore this version" "link"
|
||||
And I navigate to "Advanced features" in site administration
|
||||
Then the field "Enable badges" matches value "1"
|
||||
@@ -42,8 +40,6 @@ Feature: I can revert changes after a load
|
||||
And I should see "Disable Restriction by grouping"
|
||||
And I navigate to "Plugins > Blocks > Manage blocks" in site administration
|
||||
And I should see "Disable Logged in user"
|
||||
And I navigate to "Plugins > Course formats > Manage course formats" in site administration
|
||||
And "Disable" "icon" should exist in the "Social" "table_row"
|
||||
And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration
|
||||
And "Enabled" "icon" should exist in the "Immediate feedback with CBM" "table_row"
|
||||
And I navigate to "Plugins > Question types > Manage question types" in site administration
|
||||
|
||||
@@ -106,12 +106,12 @@ Feature: Restore Moodle 2 course backups
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Weekly sections"
|
||||
And I set the following fields to these values:
|
||||
| id_format | Social |
|
||||
| id_format | Single activity |
|
||||
And I press "Save and display"
|
||||
And I should see "An open forum for chatting about anything you want to"
|
||||
And I should see "New Forum"
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Social"
|
||||
And the field "id_format" matches value "Single activity"
|
||||
And I press "Cancel"
|
||||
|
||||
@javascript
|
||||
|
||||
@@ -5,7 +5,8 @@ Feature: Edit activities in social activities block
|
||||
I need to add and edit activities there
|
||||
|
||||
Background:
|
||||
Given the following "course" exists:
|
||||
Given I enable "social" "format" plugin
|
||||
And the following "course" exists:
|
||||
| fullname | Course 1 |
|
||||
| shortname | C1 |
|
||||
| format | social |
|
||||
|
||||
@@ -189,11 +189,13 @@ class format_singleactivity extends core_courseformat\base implements core_cours
|
||||
$activitytype = $this->get_activitytype();
|
||||
if (!empty($activitytype) && !empty($modinfo->sections)) {
|
||||
// Get the first activity of the specified type, but only if it is in the 0-section.
|
||||
$cmlist = $modinfo->sections[0];
|
||||
foreach ($cmlist as $cmid) {
|
||||
if ($modinfo->cms[$cmid]->modname === $activitytype) {
|
||||
$this->activity = $modinfo->cms[$cmid];
|
||||
break;
|
||||
if (isset($modinfo->sections[0])) {
|
||||
$cmlist = $modinfo->sections[0];
|
||||
foreach ($cmlist as $cmid) {
|
||||
if ($modinfo->cms[$cmid]->modname === $activitytype) {
|
||||
$this->activity = $modinfo->cms[$cmid];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ Feature: Change number of discussions displayed
|
||||
I need to edit the course and change the number of sections displayed.
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
Given I enable "social" "format" plugin
|
||||
And the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
|
||||
@@ -19,6 +19,12 @@ Feature: Teacher can change the course format
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And the following "activity" exists:
|
||||
| activity | forum |
|
||||
| course | C1 |
|
||||
| name | My forum name |
|
||||
| summary | Test forum 1 |
|
||||
| section | 0 |
|
||||
# Confirm that course format is Custom sections.
|
||||
When I am on the "Course 1" course page logged in as teacher1
|
||||
Then I should see "Section 1"
|
||||
@@ -71,13 +77,13 @@ Feature: Teacher can change the course format
|
||||
And I should not see "Browse the glossary using this index"
|
||||
And I am on the "Course 1" "course editing" page
|
||||
And I expand all fieldsets
|
||||
# Set course format to Social format
|
||||
And I set the field "Format" to "Social"
|
||||
# Confirm that fields that appear for Social format appears
|
||||
# Set course format to Single activity format
|
||||
And I set the field "Format" to "Single activity"
|
||||
# Confirm that fields that appear for Single activity format appears
|
||||
And I expand all fieldsets
|
||||
And I should see "Number of discussions"
|
||||
And the field "Number of discussions" matches value "10"
|
||||
And I should see "Type of activity"
|
||||
And the field "Type of activity" matches value "Forum"
|
||||
And I press "Save and display"
|
||||
# Confirm that course page displays a forum
|
||||
And I should see "There are no discussion topics yet in this forum"
|
||||
And I should see "Test forum 1"
|
||||
And I should not see "Current week"
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user