From 93b417a4ce5f8c207d5dd2cc62e16d0fb7742beb Mon Sep 17 00:00:00 2001 From: campbell-m <87438215+campbell-m@users.noreply.github.com> Date: Wed, 22 May 2024 20:44:31 +0100 Subject: [PATCH] Fix TypeError. See GitHub Issue #3675. --- web/edit_entry.php | 5 ++++- web/mrbs_sql.inc | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/edit_entry.php b/web/edit_entry.php index b987d93962..baa47335d9 100644 --- a/web/edit_entry.php +++ b/web/edit_entry.php @@ -1612,6 +1612,9 @@ function getbookingdate(int $t, bool $is_end=false) : array while (false !== ($row = $res->next_row_keyed())) { + // Cast the columns to their correct types + row_cast_columns($row, 'area'); + // We don't want areas that have no enabled rooms because it doesn't make sense // to try and select them for a booking. if (empty($rooms[$row['id']])) @@ -1629,7 +1632,7 @@ function getbookingdate(int $t, bool $is_end=false) : array $row['resolution'] = 60; } // Generate some derived settings - $row['max_duration_qty'] = $row['max_duration_secs']; + $row['max_duration_qty'] = $row['max_duration_secs']; toTimeString($row['max_duration_qty'], $row['max_duration_units']); // Get the start and end of the booking day if ($row['enable_periods']) diff --git a/web/mrbs_sql.inc b/web/mrbs_sql.inc index e473ae90b1..acb4ba4a89 100644 --- a/web/mrbs_sql.inc +++ b/web/mrbs_sql.inc @@ -730,6 +730,8 @@ function get_entry_by_id(int $id) : ?array else { $result = $res->next_row_keyed(); + // Cast the columns to their correct types + row_cast_columns($result, 'entry'); // Unpack the status bits unpack_status($result); }