Skip to content

Commit

Permalink
TW20610099, initializing historyid to avoid null on empty board
Browse files Browse the repository at this point in the history
  • Loading branch information
MichPound committed Dec 22, 2023
1 parent 3c4d470 commit 86a14a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ function board_add_instance($data, $mform = null) {
$data->postby = 0;
}

// Initialize historyid as 0 to avoid null errors for boards with no posts.
if (empty($data->historyid)) {
$data->historyid = 0;
}

// Add 3 default columns.
$boardid = $DB->insert_record('board', $data);
if ($boardid) {
Expand Down

0 comments on commit 86a14a5

Please sign in to comment.