v0.47.1 Fix .id nil bug
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
				
			|||||||
# Federated Computer, Inc.
 | 
					# Federated Computer, Inc.
 | 
				
			||||||
# David Sainty <saint@federated.computer>  2024 A.D.
 | 
					# David Sainty <saint@federated.computer>  2024 A.D.
 | 
				
			||||||
# Gossamer Threads to Discourse -- Migration-Import Script
 | 
					# 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 'mysql2'
 | 
				
			||||||
require 'open-uri'
 | 
					require 'open-uri'
 | 
				
			||||||
@@ -1384,6 +1384,10 @@ class GossamerForumsImporter < ImportScripts::Base
 | 
				
			|||||||
##            begin
 | 
					##            begin
 | 
				
			||||||
              # Fetch the discourse user ID for the reply
 | 
					              # Fetch the discourse user ID for the reply
 | 
				
			||||||
              reply_user_id = fetch_user_id_mapping(reply_row['user_id_fk'])
 | 
					              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}"
 | 
					      puts "TIJ II post_id #{post_id}"
 | 
				
			||||||
              # Sanitize and prepare the reply message for Discourse
 | 
					              # Sanitize and prepare the reply message for Discourse
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user