Skip to content

Session date is always session status in export #233

@djarran

Description

@djarran

Description: In the following function, $sessiondate is never defined and so it will always write the session status for the session date column

moodle-mod_facetoface/lib.php

Lines 1766 to 1799 in af644c7

function facetoface_write_activity_attendance_helper(
&$worksheet,
$i,
$session,
$customsessionfields,
$status,
$dateformat,
$starttime,
$finishtime
) {
global $DB;
$j = 0;
// Custom session fields.
$customdata = $DB->get_records('facetoface_session_data', ['sessionid' => $session->id], '', 'fieldid, data');
foreach ($customsessionfields as $field) {
if (empty($field->showinsummary)) {
continue; // Skip.
}
$data = '-';
if (!empty($customdata[$field->id])) {
if (CUSTOMFIELD_TYPE_MULTISELECT == $field->type) {
$data = str_replace(CUSTOMFIELD_DELIMITER, "\n", $customdata[$field->id]->data);
} else {
$data = $customdata[$field->id]->data;
}
}
$worksheet->write_string($i, $j++, $data);
}
if (empty($sessiondate)) {
$worksheet->write_string($i, $j++, $status); // Session date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions