protected function warn_about_invalid_availability(\coding_exception $e) {
        $name = $this->get_thing_name();
        // If it occurs while building modinfo based on somebody calling $cm->name,
        // we can't get $cm->name, and this line will cause a warning.
        $htmlname = @$this->format_info($name, $this->course);
        if ($htmlname === '') {
            // So instead use the numbers (cmid) from the tag.
            $htmlname = preg_replace('~[^0-9]~', '', $name);
        }
        $info = 'Error processing availability data for &lsquo;' . $htmlname
                 . '&rsquo;: ' . s($e->a);
        debugging($info, DEBUG_DEVELOPER);
    }