public static function apply_component_provide_event_action(event_interface $event) {
        // Callbacks will get supplied a "legacy" version
        // of the event class.
        $mapper = self::$eventmapper;
        $action = null;
        if ($event->get_course_module()) {
            $requestinguserid = self::get_requesting_user();
            $legacyevent = $mapper->from_event_to_legacy_event($event);
            // We know for a fact that the the requesting user might be different from the logged in user,
            // but the event mapper is not aware of that.
            if (empty($event->user) && !empty($legacyevent->userid)) {
                $legacyevent->userid = $requestinguserid;
            }

            // TODO MDL-58866 Only activity modules currently support this callback.
            // Any other event will not be displayed on the dashboard.
            $action = component_callback(
                'mod_' . $event->get_course_module()->get('modname'),
                'core_calendar_provide_event_action',
                [
                    $legacyevent,
                    self::$actionfactory,
                    $requestinguserid
                ]
            );
        }

        // If we get an action back, return an action event, otherwise
        // continue piping through the original event.
        //
        // If a module does not implement the callback, component_callback
        // returns null.
        return $action ? new action_event($event, $action) : $event;
    }