0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-09-18 23:01:11 +02:00

FIX: Use wizard_submission_id instead of new value

Dieser Commit ist enthalten in:
jumagura 2023-10-02 22:05:28 -04:00
Ursprung 3433bd4141
Commit 1d2f75951f
2 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -63,7 +63,6 @@ class CustomWizard::Action
def create_topic
params = basic_topic_params.merge(public_topic_params)
params[:from_wizard] = true
callbacks_for(:before_create_topic).each do |acb|
params = acb.call(params, @wizard, @action, @submission)

Datei anzeigen

@ -239,10 +239,14 @@ after_initialize do
on(:before_create_topic) do |topic_params, user|
next if topic_params[:archetype] == 'message'
if topic_params[:category]&.custom_fields&.[]('create_topic_wizard').present? && !topic_params[:from_wizard]
category = topic_params.category
wizard_submission_id = topic_params.custom_fields['wizard_submission_id']
if category&.custom_fields&.[]('create_topic_wizard').present? && wizard_submission_id.blank?
raise Discourse::InvalidParameters.new(
I18n.t('wizard.error_messages.wizard_replacing_composer')
)
end
end
end