v0.47.1 Fix .id nil bug

This commit is contained in:
David Sainty 2024-08-18 16:08:14 +10:00
parent 468b8b725b
commit 3e608d599b

View File

@ -1,7 +1,7 @@
# Federated Computer, Inc.
# David Sainty <saint@federated.computer> 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