mirror of
https://github.com/discourse/discourse.git
synced 2025-04-17 12:49:04 +08:00
FIX: base script import to handle category color/text color
This commit is contained in:
parent
f0b35b2fe2
commit
dcc4267490
@ -370,7 +370,9 @@ class ImportScripts::Base
|
|||||||
user_id: opts[:user_id] || opts[:user].try(:id) || -1,
|
user_id: opts[:user_id] || opts[:user].try(:id) || -1,
|
||||||
position: opts[:position],
|
position: opts[:position],
|
||||||
description: opts[:description],
|
description: opts[:description],
|
||||||
parent_category_id: opts[:parent_category_id]
|
parent_category_id: opts[:parent_category_id],
|
||||||
|
color: opts[:color] || "AB9364",
|
||||||
|
text_color: opts[:text_color] || "FFF",
|
||||||
)
|
)
|
||||||
|
|
||||||
new_category.custom_fields["import_id"] = import_id if import_id
|
new_category.custom_fields["import_id"] = import_id if import_id
|
||||||
|
@ -8,7 +8,6 @@ require File.expand_path(File.dirname(__FILE__) + "/base.rb")
|
|||||||
BB_PRESS_DB = ENV['BBPRESS_DB'] || "bbpress"
|
BB_PRESS_DB = ENV['BBPRESS_DB'] || "bbpress"
|
||||||
DB_TABLE_PREFIX = "wp_"
|
DB_TABLE_PREFIX = "wp_"
|
||||||
|
|
||||||
|
|
||||||
class ImportScripts::Bbpress < ImportScripts::Base
|
class ImportScripts::Bbpress < ImportScripts::Base
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# bespoke importer for a customer, feel free to borrow ideas
|
# bespoke importer for a customer, feel free to borrow ideas
|
||||||
#
|
|
||||||
#
|
|
||||||
require 'csv'
|
require 'csv'
|
||||||
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
|
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
require "mysql2"
|
require "mysql2"
|
||||||
|
|
||||||
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
|
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
|
||||||
|
|
||||||
# Call it like this:
|
# Call it like this:
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
require 'mysql2'
|
require 'mysql2'
|
||||||
|
|
||||||
require File.expand_path(File.dirname(__FILE__) + '/base.rb')
|
require File.expand_path(File.dirname(__FILE__) + '/base.rb')
|
||||||
|
|
||||||
require 'htmlentities'
|
require 'htmlentities'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user