fix error
This commit is contained in:
parent
da75073ecc
commit
4f65a30a85
|
@ -178,8 +178,8 @@ class Admin::AsksController < OrbitAdminController
|
||||||
if format_text[-7...-1] == '_title'
|
if format_text[-7...-1] == '_title'
|
||||||
case format_text[1...-7]
|
case format_text[1...-7]
|
||||||
when /custom\d+/
|
when /custom\d+/
|
||||||
i = format_text.scan(/\d+/)[0].to_i
|
i = format_text.scan(/\d+/)[0]
|
||||||
k = custom_fields.keys[i-1]
|
k = custom_fields.keys.index(i) rescue nil
|
||||||
if !k.blank?
|
if !k.blank?
|
||||||
text_tp = custom_fields[k]['field'][I18n.locale] rescue ''
|
text_tp = custom_fields[k]['field'][I18n.locale] rescue ''
|
||||||
text = text.gsub(format_text,text_tp)
|
text = text.gsub(format_text,text_tp)
|
||||||
|
@ -223,16 +223,16 @@ class Admin::AsksController < OrbitAdminController
|
||||||
text = text.gsub(format_text,I18n.t('ask,no'))
|
text = text.gsub(format_text,I18n.t('ask,no'))
|
||||||
end
|
end
|
||||||
when /custom\d+\|format/
|
when /custom\d+\|format/
|
||||||
i = format_text.scan(/\d+/)[0].to_i
|
i = format_text.scan(/\d+/)[0]
|
||||||
k = custom_fields.keys[i-1]
|
k = custom_fields.keys.index(i) rescue nil
|
||||||
if !k.blank?
|
if !k.blank?
|
||||||
v = custom_fields[k] rescue {}
|
v = custom_fields[k] rescue {}
|
||||||
text_tp = Admin::AsksHelper.show_on_front(k,v,@ask_question.custom_values[k],true,true)
|
text_tp = Admin::AsksHelper.show_on_front(k,v,@ask_question.custom_values[k],true,true)
|
||||||
text = text.gsub(format_text,text_tp.to_s)
|
text = text.gsub(format_text,text_tp.to_s)
|
||||||
end
|
end
|
||||||
when /custom\d+/
|
when /custom\d+/
|
||||||
i = format_text.scan(/\d+/)[0].to_i
|
i = format_text.scan(/\d+/)[0]
|
||||||
k = custom_fields.keys[i-1]
|
k = custom_fields.keys.index(i) rescue nil
|
||||||
if !k.blank?
|
if !k.blank?
|
||||||
v = custom_fields[k] rescue {}
|
v = custom_fields[k] rescue {}
|
||||||
text_tp = Admin::AsksHelper.show_on_front(k,v,@ask_question.custom_values[k],true)
|
text_tp = Admin::AsksHelper.show_on_front(k,v,@ask_question.custom_values[k],true)
|
||||||
|
|
Loading…
Reference in New Issue