Skip to content

Commit

Permalink
MDL-84267 mod_data: deprecate unused comment related capabilities.
Browse files Browse the repository at this point in the history
They were replaced with core comment API in, and have been unused
since, both 4311073 & e998eff.
  • Loading branch information
paulholden committed Jan 21, 2025
1 parent a2653cc commit a2e8872
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 51 deletions.
9 changes: 9 additions & 0 deletions .upgradenotes/MDL-84267-2025012110222203.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
issueNumber: MDL-84267
notes:
mod_data:
- message: |-
The following unused capabilities have been deprecated:
* `mod/data:comment`
* `mod/data:managecomments`
type: deprecated
18 changes: 0 additions & 18 deletions backup/cc/sheets/moodle_blti_export.xml
Original file line number Diff line number Diff line change
Expand Up @@ -847,18 +847,6 @@
<TIMEMODIFIED>1311692131</TIMEMODIFIED>
<MODIFIERID>0</MODIFIERID>
</CAPABILITY>
<CAPABILITY>
<NAME>mod/data:managecomments</NAME>
<PERMISSION>1</PERMISSION>
<TIMEMODIFIED>1311692131</TIMEMODIFIED>
<MODIFIERID>0</MODIFIERID>
</CAPABILITY>
<CAPABILITY>
<NAME>mod/data:comment</NAME>
<PERMISSION>1</PERMISSION>
<TIMEMODIFIED>1311692131</TIMEMODIFIED>
<MODIFIERID>0</MODIFIERID>
</CAPABILITY>
<CAPABILITY>
<NAME>mod/data:approve</NAME>
<PERMISSION>1</PERMISSION>
Expand Down Expand Up @@ -1244,12 +1232,6 @@
<TIMEMODIFIED>1311692130</TIMEMODIFIED>
<MODIFIERID>0</MODIFIERID>
</CAPABILITY>
<CAPABILITY>
<NAME>mod/data:comment</NAME>
<PERMISSION>1</PERMISSION>
<TIMEMODIFIED>1311692130</TIMEMODIFIED>
<MODIFIERID>0</MODIFIERID>
</CAPABILITY>
<CAPABILITY>
<NAME>mod/choice:choose</NAME>
<PERMISSION>1</PERMISSION>
Expand Down
32 changes: 4 additions & 28 deletions mod/data/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,6 @@
)
),

'mod/data:comment' => array(

'riskbitmask' => RISK_SPAM,

'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),

'mod/data:rate' => array(

'captype' => 'write',
Expand Down Expand Up @@ -154,19 +140,6 @@
)
),

'mod/data:managecomments' => array(

'riskbitmask' => RISK_SPAM,

'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),

'mod/data:managetemplates' => array(

'riskbitmask' => RISK_SPAM | RISK_XSS,
Expand Down Expand Up @@ -265,4 +238,7 @@
)
);


$deprecatedcapabilities = [
'mod/data:comment' => ['message' => 'This capability should not be used anymore.'],
'mod/data:managecomments' => ['message' => 'This capability should not be used anymore.'],
];
8 changes: 4 additions & 4 deletions mod/data/lang/en/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@
$string['csvwithselecteddelimiter'] = '<abbr title="Comma Separated Values">CSV</abbr>';
$string['data:addinstance'] = 'Add a new database';
$string['data:approve'] = 'Approve and undo approved entries';
$string['data:comment'] = 'Write comments';
$string['data:exportallentries'] = 'Export all database entries';
$string['data:exportentry'] = 'Export a database entry';
$string['data:exportownentry'] = 'Export own database entry';
$string['data:exportuserinfo'] = 'Export user information';
$string['data:managecomments'] = 'Manage comments';
$string['data:manageentries'] = 'Manage entries';
$string['data:managetemplates'] = 'Manage templates';
$string['data:manageuserpresets'] = 'Manage presets';
Expand Down Expand Up @@ -479,7 +477,9 @@
// Deprecated since Moodle 4.3.
$string['completionentries'] = 'Require entries';

// Deprecated since Moodle 4.4.

// Deprecated since Moodle 4.5.
$string['tagsdeleted'] = 'Database tags have been deleted';

// Deprecated since Moodle 5.0.
$string['data:comment'] = 'Write comments';
$string['data:managecomments'] = 'Manage comments';
2 changes: 2 additions & 0 deletions mod/data/lang/en/deprecated.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
fieldids,mod_data
completionentries,mod_data
tagsdeleted,mod_data
data:comment,mod_data
data:managecomments,mod_data
2 changes: 1 addition & 1 deletion mod/data/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2024121800; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2025012100; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2024100100; // Requires this Moodle version.
$plugin->component = 'mod_data'; // Full name of the plugin (used for diagnostics)
$plugin->cron = 0;

0 comments on commit a2e8872

Please sign in to comment.