If one removes moodle/course:changesummary permission the user can not edit other course fields, such as, for example, the number of topics or the format of the course because the form always requires summary and summaryformat to be specified. However, the user can not edit them since they are invisible as expected.
Replication instructions:
- remove moodle/course:changesummary from teacher role
- edit a course configuration
- summary / summaryformat fields are not displayed
- change number of topics of the course and save the form
Moodle throws an error writing to the database.
The reason is:
Debug info: Column 'summaryformat' cannot be null
|
UPDATE course SET category = ?,fullname = ?,shortname = ?,idnumber = ?,format = ?,numsections = ?,startdate = ?,hiddensections = ?,newsitems = ?,showgrades = ?,showreports = ?,maxbytes = ?,groupmode = ?,groupmodeforce = ?,defaultgroupingid = ?,visible = ?,lang = ?,enablecompletion = ?,completionstartonenrol = ?,restrictmodules = ?,timemodified = ?,summary = ?,summaryformat = ? WHERE id=?
|
[array (
|
0 => '10',
|
1 => 'COURSE',
|
2 => 'SHORTNAME',
|
3 => '',
|
4 => 'topics',
|
5 => '12',
|
6 => 1314831600,
|
7 => '0',
|
8 => '5',
|
9 => '1',
|
10 => '0',
|
11 => '33554432',
|
12 => '0',
|
13 => '0',
|
14 => '0',
|
15 => '1',
|
16 => '',
|
17 => 0,
|
18 => 0,
|
19 => 0,
|
20 => 1315255126,
|
21 => NULL,
|
22 => NULL,
|
23 => 32,
|
)]
|
- duplicates
-
MDL-27762 User without moodle/course:changesummary capability receives database error when saving course settings
- Closed