mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
[#59359] redirect to edit path after creating a custom field
- https://community.openproject.org/work_packages/59359
This commit is contained in:
@@ -55,9 +55,10 @@ module CustomFields
|
||||
.call(get_custom_field_params.merge(type: permitted_params.custom_field_type))
|
||||
|
||||
if call.success?
|
||||
custom_field = call.result
|
||||
flash[:notice] = t(:notice_successful_create)
|
||||
call_hook(:controller_custom_fields_new_after_save, custom_field: call.result)
|
||||
redirect_to index_path(call.result, tab: call.result.class.name)
|
||||
call_hook(:controller_custom_fields_new_after_save, custom_field:)
|
||||
redirect_to edit_path(custom_field, id: custom_field.id)
|
||||
else
|
||||
@custom_field = call.result || new_custom_field
|
||||
render action: :new, status: :unprocessable_entity
|
||||
@@ -142,7 +143,7 @@ module CustomFields
|
||||
|
||||
index = 0
|
||||
|
||||
params[:custom_field][:custom_options_attributes].each do |_id, attributes|
|
||||
params[:custom_field][:custom_options_attributes].each_value do |attributes|
|
||||
attributes[:position] = (index = index + 1)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user