Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
Ensure added fields have a key and value
Dieser Commit ist enthalten in:
Ursprung
17ba9976c0
Commit
9bbc72481a
1 geänderte Dateien mit 16 neuen und 18 gelöschten Zeilen
|
@ -60,7 +60,7 @@ class CustomWizard::Builder
|
|||
|
||||
if step_template['fields'] && step_template['fields'].length
|
||||
step_template['fields'].each do |field|
|
||||
validate_field(field, updater)
|
||||
validate_field(field, updater) if field['type'] != 'text-only'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -255,14 +255,11 @@ class CustomWizard::Builder
|
|||
|
||||
if action['add_fields']
|
||||
action['add_fields'].each do |field|
|
||||
if field['value_custom']
|
||||
value = field['value_custom']
|
||||
else
|
||||
value = data[field['value']]
|
||||
end
|
||||
value = field['value_custom'] ? field['value_custom'] : data[field['value']]
|
||||
key = field['key']
|
||||
|
||||
if key && key.include?('custom_fields')
|
||||
if key && value
|
||||
if key.include?('custom_fields')
|
||||
keyArr = key.split('.')
|
||||
|
||||
if keyArr.length === 3
|
||||
|
@ -281,6 +278,7 @@ class CustomWizard::Builder
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
creator = PostCreator.new(user, params)
|
||||
post = creator.create
|
||||
|
|
Laden …
In neuem Issue referenzieren