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

We should use the cm_info data before calling callbacks

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:

      Description

      The is_event_visible callback should perform the following (pseudo) code before implementing it's own functionality.

      $cm = get_fast_modinfo($event->courseid)->instances['scorm'][$event->instance];
      return $cm->visible
      

      The code above does a bunch of checks including restrict access settings.

      We could remove this callback from most modules and have the event_factory perform this, saving duplicated code and third-party devs having to implement a function.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cameron1729 cameron1729
              Reporter:
              markn Mark Nelson
              Peer reviewer:
              Mark Nelson
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: