Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
Profile updates bugfixes
Dieser Commit ist enthalten in:
Ursprung
961ad8cc27
Commit
83b49a9082
1 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen
|
@ -455,8 +455,8 @@ class CustomWizard::Builder
|
||||||
action['profile_updates'].each do |pu|
|
action['profile_updates'].each do |pu|
|
||||||
value = pu['value']
|
value = pu['value']
|
||||||
custom_field = nil
|
custom_field = nil
|
||||||
|
|
||||||
if pu['value_custom']
|
if pu['value_custom'].present?
|
||||||
custom_parts = pu['value_custom'].split('.')
|
custom_parts = pu['value_custom'].split('.')
|
||||||
if custom_parts.length == 2 && custom_parts[0] == 'custom_field'
|
if custom_parts.length == 2 && custom_parts[0] == 'custom_field'
|
||||||
custom_field = custom_parts[1]
|
custom_field = custom_parts[1]
|
||||||
|
@ -471,14 +471,20 @@ class CustomWizard::Builder
|
||||||
if user_field || custom_field
|
if user_field || custom_field
|
||||||
custom_fields[user_field || custom_field] = data[key]
|
custom_fields[user_field || custom_field] = data[key]
|
||||||
else
|
else
|
||||||
attributes[value.to_sym] = data[key]
|
updater_key = value
|
||||||
|
|
||||||
|
if ['profile_background', 'card_background'].include?(value)
|
||||||
|
updater_key = "#{value}_upload_url"
|
||||||
|
end
|
||||||
|
|
||||||
|
attributes[updater_key.to_sym] = data[key] if updater_key
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if custom_fields.present?
|
if custom_fields.present?
|
||||||
attributes[:custom_fields] = custom_fields
|
attributes[:custom_fields] = custom_fields
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes.present?
|
if attributes.present?
|
||||||
user_updater = UserUpdater.new(user, user)
|
user_updater = UserUpdater.new(user, user)
|
||||||
user_updater.update(attributes)
|
user_updater.update(attributes)
|
||||||
|
|
Laden …
In neuem Issue referenzieren