Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43207

Editing an activity name from the course view does not trigger a mod_updated event

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.5.3
    • Course, Events API
    • None
    • MOODLE_25_STABLE

      When modifying an activity name via the main course view does not trigger the mod_updated event.

      See course/rest.php case statement updatetitle, when the title is updated the mod_updated event is not triggered.

                              require_capability('moodle/course:manageactivities', $modcontext);
                              require_once($CFG->libdir . '/gradelib.php');
                              $cm = get_coursemodule_from_id('', $id, 0, false, MUST_EXIST);
                              $module = new stdClass();
                              $module->id = $cm->instance;
       
                              // Escape strings as they would be by mform
                              if (!empty($CFG->formatstringstriptags)) {
                                  $module->name = clean_param($title, PARAM_TEXT);
                              } else {
                                  $module->name = clean_param($title, PARAM_CLEANHTML);
                              }
       
                              if (!empty($module->name)) {
                                  $DB->update_record($cm->modname, $module);
                                  rebuild_course_cache($cm->course);
                              } else {
                                  $module->name = $cm->name;
                              }
       
                              // Attempt to update the grade item if relevant
                              $grademodule = $DB->get_record($cm->modname, array('id' => $cm->instance));
                              $grademodule->cmidnumber = $cm->idnumber;
                              $grademodule->modname = $cm->modname;
                              grade_update_mod_grades($grademodule);
       
                              // We need to return strings after they've been through filters for multilang
                              $stringoptions = new stdClass;
                              $stringoptions->context = $coursecontext;
                              echo json_encode(array('instancename' => html_entity_decode(format_string($module->name, true,  $stringoptions))));

            Unassigned Unassigned
            adelamarre Akin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.