Merge pull request #8388 from andrej-scinote/aj_SCI_11776

Fix form duplicate activity [SCI-11776]
This commit is contained in:
andrej-scinote 2025-04-03 12:08:36 +02:00 committed by GitHub
commit 06127357b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -167,7 +167,7 @@ class FormsController < ApplicationController
def duplicate
ActiveRecord::Base.transaction do
new_form = @form.duplicate!(current_user)
log_activity(@form, :form_duplicated, { form_new: new_form.id })
log_activity(new_form, :form_duplicated, { form_old: @form.id })
render json: { message: t('forms.duplicated.success_flash', name: escape_input(@form.name)) }
rescue ActiveRecord::RecordInvalid
render json: { error: new_form.errors.full_messages }, status: :unprocessable_entity

View file

@ -369,7 +369,7 @@ en:
protocol_step_form_added_html: "%{user} added form <strong>%{form}</strong> in protocol's step %{step_position} <strong>%{step}</strong> in Protocol repository."
protocol_step_form_deleted_html: "%{user} deleted form <strong>%{form}</strong> in protocol's step %{step_position} <strong>%{step}</strong> in Protocol repository."
protocol_step_form_moved_html: "%{user} moved form <strong>%{form}</strong> in protocol's step %{step_position} <strong>%{step}</strong> to step %{step_position_destination} <strong>%{step_destination}</strong> in Protocol repository."
form_duplicated_html: "%{user} duplicated form %{form_new} from %{form} in Forms."
form_duplicated_html: "%{user} duplicated form %{form} from %{form_old} in Forms."
form_block_duplicated_html: "%{user} duplicated form block %{block_name} in form %{form} in Form templates."
form_unpublished_html: "%{user} unpublished form %{form}."
activity_name: