mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Importers should allow categories with existing name if the parent category is different
This changes the content of `@categories_lookup` from `Category` objects to IDs since the category names aren't needed anymore. The lookup method has been renamed too.
This commit is contained in:
@ -181,7 +181,7 @@ class ImportScripts::VBulletin < ImportScripts::Base
|
||||
name: @htmlentities.decode(category["title"]).strip,
|
||||
position: category["displayorder"],
|
||||
description: @htmlentities.decode(category["description"]).strip,
|
||||
parent_category_id: category_from_imported_category_id(category["parentid"]).try(:[], "id")
|
||||
parent_category_id: category_id_from_imported_category_id(category["parentid"])
|
||||
}
|
||||
end
|
||||
end
|
||||
@ -216,7 +216,7 @@ class ImportScripts::VBulletin < ImportScripts::Base
|
||||
id: topic_id,
|
||||
user_id: user_id_from_imported_user_id(topic["postuserid"]) || Discourse::SYSTEM_USER_ID,
|
||||
title: @htmlentities.decode(topic["title"]).strip[0...255],
|
||||
category: category_from_imported_category_id(topic["forumid"]).try(:name),
|
||||
category: category_id_from_imported_category_id(topic["forumid"]),
|
||||
raw: raw,
|
||||
created_at: parse_timestamp(topic["dateline"]),
|
||||
visible: topic["visible"].to_i == 1,
|
||||
|
Reference in New Issue
Block a user