Browse Source

Fixed event editing

development
Godwin 7 years ago
parent
commit
c3591ba987
  1. 5
      app/controllers/conference_administration_controller.rb
  2. 4
      app/helpers/form_helper.rb

5
app/controllers/conference_administration_controller.rb

@ -44,6 +44,7 @@ class ConferenceAdministrationController < ApplicationController
end
def edit_event
@event = Event.find(params[:id])
administration_step(:event_edit)
end
@ -1473,11 +1474,11 @@ class ConferenceAdministrationController < ApplicationController
# save translations
(params[:info] || {}).each do |locale, value|
event.set_column_for_locale(:title, locale, html_value(value), current_user.id) unless value = event._title(locale)
event.set_column_for_locale(:info, locale, value, current_user.id) if value != event._info(locale) && view_context.strip_tags(value).strip.present?
end
(params[:title] || {}).each do |locale, value|
event.set_column_for_locale(:info, locale, value, current_user.id) unless value = event._info(locale)
event.set_column_for_locale(:title, locale, html_value(value), current_user.id) if value != event._title(locale) && view_context.strip_tags(value).strip.present?
end
event.save

4
app/helpers/form_helper.rb

@ -27,9 +27,7 @@ module FormHelper
value = object.is_a?(Hash) ? object[locale.to_sym] : object.get_column_for_locale!(name, locale, false)
# use the default value if we need to
if _options[:default].present? && value.blank?
value = _(_options[:default], locale: locale)
end
value = _(_options[:default], locale: locale) if _options[:default].present? && value.blank?
_options[:index] = locale
_options[:lang] = locale

Loading…
Cancel
Save