FIX: category_importer was importing public categories so that no one had permission to them, not even staff
This commit is contained in:
parent
96daf5431f
commit
36a80871a3
|
@ -47,7 +47,7 @@ module ImportExport
|
||||||
parent = Category.new(@export_data[:category])
|
parent = Category.new(@export_data[:category])
|
||||||
parent.user_id = @topic_importer.new_user_id(@export_data[:category][:user_id]) # imported user's new id
|
parent.user_id = @topic_importer.new_user_id(@export_data[:category][:user_id]) # imported user's new id
|
||||||
parent.custom_fields["import_id"] = id
|
parent.custom_fields["import_id"] = id
|
||||||
parent.permissions = permissions if permissions
|
parent.permissions = permissions.present? ? permissions : {"everyone" => CategoryGroup.permission_types[:full]}
|
||||||
parent.save!
|
parent.save!
|
||||||
set_category_description(parent, @export_data[:category][:description])
|
set_category_description(parent, @export_data[:category][:description])
|
||||||
end
|
end
|
||||||
|
@ -62,7 +62,7 @@ module ImportExport
|
||||||
subcategory.parent_category_id = parent.id
|
subcategory.parent_category_id = parent.id
|
||||||
subcategory.user_id = @topic_importer.new_user_id(cat_attrs[:user_id])
|
subcategory.user_id = @topic_importer.new_user_id(cat_attrs[:user_id])
|
||||||
subcategory.custom_fields["import_id"] = id
|
subcategory.custom_fields["import_id"] = id
|
||||||
subcategory.permissions = permissions if permissions
|
subcategory.permissions = permissions.present? ? permissions : {"everyone" => CategoryGroup.permission_types[:full]}
|
||||||
subcategory.save!
|
subcategory.save!
|
||||||
set_category_description(subcategory, cat_attrs[:description])
|
set_category_description(subcategory, cat_attrs[:description])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue