From cb521bff109253cbc8fdd8afe0383bdd41c0119d Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sat, 23 Mar 2019 22:11:55 -0700 Subject: [PATCH] Fix migration errors with deleted users --- migrations/m9_remove_idea_bot.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migrations/m9_remove_idea_bot.php b/migrations/m9_remove_idea_bot.php index cfffae56..a69683ce 100644 --- a/migrations/m9_remove_idea_bot.php +++ b/migrations/m9_remove_idea_bot.php @@ -73,10 +73,10 @@ public function update_topic_authors() while ($row = $this->db->sql_fetchrow($result)) { $topics[$row['topic_id']] = [ - 'topic_poster_id' => $row['idea_author'], - 'topic_poster_name' => $row['username'], - 'topic_poster_colour' => $row['user_colour'], - 'topic_first_post_id' => $row['topic_first_post_id'], + 'topic_poster_id' => $row['idea_author'] ?: ANONYMOUS, + 'topic_poster_name' => $row['username'] ?: '', + 'topic_poster_colour' => $row['user_colour'] ?: '', + 'topic_first_post_id' => $row['topic_first_post_id'] ?: 0, ]; } $this->db->sql_freeresult($result);