mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FIX: allow array values for custom fields in category params. (#17692)
Previously, when we used `params[:custom_fields].try(:keys)` code it worked for all the custom fields unless it's an array. It created the problem in the discourse-restricted-replies plugin. https://github.com/discourse/discourse-restricted-replies/pull/37#issuecomment-1194207693
This commit is contained in:
@ -520,7 +520,8 @@ describe CategoriesController do
|
||||
"staff" => create_post
|
||||
},
|
||||
custom_fields: {
|
||||
"dancing" => "frogs"
|
||||
"dancing" => "frogs",
|
||||
"running" => ["turtle", "salamander"]
|
||||
},
|
||||
minimum_required_tags: "",
|
||||
allow_global_tags: 'true',
|
||||
@ -539,7 +540,7 @@ describe CategoriesController do
|
||||
expect(category.slug).to eq("hello-category")
|
||||
expect(category.color).to eq("ff0")
|
||||
expect(category.auto_close_hours).to eq(72)
|
||||
expect(category.custom_fields).to eq("dancing" => "frogs")
|
||||
expect(category.custom_fields).to eq("dancing" => "frogs", "running" => ["turtle", "salamander"])
|
||||
expect(category.minimum_required_tags).to eq(0)
|
||||
expect(category.allow_global_tags).to eq(true)
|
||||
expect(category.category_required_tag_groups.count).to eq(1)
|
||||
|
Reference in New Issue
Block a user