Merge branch 'MDL-79610-main' of https://github.com/roland04/moodle

This commit is contained in:
Sara Arjona
2023-11-29 16:37:03 +01:00
2 changed files with 16 additions and 0 deletions
@@ -264,3 +264,16 @@ Feature: edit_availability
And I should not see "Content"
And I should see "Collapse all"
And I should not see "Expand all"
@javascript
Scenario: Edit activity availability button is shown after duplicating an activity
# Setting a restriction up
Given I am on the "MyForum" "forum activity editing" page logged in as teacher1
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Date" "button" in the "Add restriction..." "dialogue"
When I press "Save and return to course"
And I turn editing mode on
And I duplicate "MyForum" activity
# Testing edit restrictions link
Then "Edit restrictions" "link" should exist in the "MyForum (copy)" "core_availability > Activity availability"
@@ -107,6 +107,8 @@ class cm implements named_templatable, renderable {
* @return stdClass data context for a mustache template
*/
public function export_for_template(renderer_base $output): stdClass {
global $PAGE;
$mod = $this->mod;
$displayoptions = $this->displayoptions;
@@ -118,6 +120,7 @@ class cm implements named_templatable, renderable {
'textclasses' => $displayoptions['textclasses'],
'classlist' => [],
'cmid' => $mod->id,
'editing' => $PAGE->user_is_editing(),
];
// Add partial data segments.