Skip to content

Commit

Permalink
Fix TypeErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed Jun 18, 2024
1 parent c163db8 commit 0993eb8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions web/functions_ical.inc
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ function export_icalendar(DBStatement $res, bool $keep_private, int $export_end=

for ($i=0; (false !== ($row = $res->next_row_keyed())); $i++)
{
row_cast_columns($row, 'entry');
unpack_status($row);
// If this is an individual entry, then construct an event
if (!isset($row['rep_type']) || ($row['rep_type'] == RepeatRule::NONE))
Expand Down
6 changes: 3 additions & 3 deletions web/lib/MRBS/ICalendar/Series.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ private static function addRepeatRule(array $row) : array
{
// Construct the repeat rule and add it to the row
$repeat_rule = new RepeatRule();
$repeat_rule->setType($row['rep_type']);
$repeat_rule->setInterval($row['rep_interval']);
$repeat_rule->setType((int)$row['rep_type']);
$repeat_rule->setInterval((int)$row['rep_interval']);
$repeat_end_date = new DateTime();
$repeat_end_date->setTimestamp($row['end_date']);
$repeat_end_date->setTimestamp((int)$row['end_date']);
$repeat_rule->setEndDate($repeat_end_date);
$repeat_rule->setDaysFromOpt($row['rep_opt']);

Expand Down
9 changes: 8 additions & 1 deletion web/mrbs_sql.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,14 @@ function get_repeat(int $repeat_id) : ?array

$res = db()->query($sql, array(':repeat_id' => $repeat_id));

return ($res->count() == 0) ? null : $res->next_row_keyed();
if (($res->count() == 0))
{
return null;
}
$row = $res->next_row_keyed();
row_cast_columns($row, 'repeat');

return $row;
}

// Update the time of last reminding.
Expand Down

0 comments on commit 0993eb8

Please sign in to comment.