From cc46ab5bb1e7cdf86416d096c70d18878dd2c086 Mon Sep 17 00:00:00 2001 From: Jay Pfaffman Date: Tue, 26 Dec 2017 21:56:36 -0800 Subject: [PATCH] smf2: deal with duplicate category names (#5435) --- script/import_scripts/smf2.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/import_scripts/smf2.rb b/script/import_scripts/smf2.rb index 3fc091b0c4f..5dc36d44533 100644 --- a/script/import_scripts/smf2.rb +++ b/script/import_scripts/smf2.rb @@ -1,3 +1,4 @@ +# coding: utf-8 require 'mysql2' require File.expand_path(File.dirname(__FILE__) + '/base.rb') @@ -152,6 +153,9 @@ class ImportScripts::Smf2 < ImportScripts::Base parent_id = category_id_from_imported_category_id(board[:id_parent]) if board[:id_parent] > 0 groups = (board[:member_groups] || "").split(/,/).map(&:to_i) restricted = !groups.include?(GUEST_GROUP) && !groups.include?(MEMBER_GROUP) + if Category.find_by_name(board[:name]) + board[:name] += board[:id_board].to_s + end { id: board[:id_board], name: board[:name],