From 3e608d599bed140c06e1a64d6caad58a6f6e8923 Mon Sep 17 00:00:00 2001 From: saint Date: Sun, 18 Aug 2024 16:08:14 +1000 Subject: [PATCH] v0.47.1 Fix .id nil bug --- gossamer_forums.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 021472f..be954c2 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1,7 +1,7 @@ # Federated Computer, Inc. # David Sainty 2024 A.D. # Gossamer Threads to Discourse -- Migration-Import Script -# v0.47 Significant tweaks and workarounds to try to improve smooth operation. +# v0.47.1 Fix .id nil bug require 'mysql2' require 'open-uri' @@ -1384,6 +1384,10 @@ class GossamerForumsImporter < ImportScripts::Base ## begin # Fetch the discourse user ID for the reply reply_user_id = fetch_user_id_mapping(reply_row['user_id_fk']) + if reply_user_id = 0 + former_user = User.find_by(username: 'Former_User') + reply_user_id = former.user.id + end puts "TIJ II post_id #{post_id}" # Sanitize and prepare the reply message for Discourse