Fix page part update when no tag or category
This commit is contained in:
parent
b864cc0268
commit
e208e99a73
|
@ -59,17 +59,17 @@ class Admin::PagePartsController < ApplicationController
|
||||||
params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type],params[:page_part][:widget_field_is_link] ) if params[:page_part][:widget_field]
|
params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type],params[:page_part][:widget_field_is_link] ) if params[:page_part][:widget_field]
|
||||||
|
|
||||||
params[:page_part][:widget_field_type] = nil
|
params[:page_part][:widget_field_type] = nil
|
||||||
params[:page_part][:widget_field_is_link] = nil
|
params[:page_part][:widget_field_is_link] = nil
|
||||||
|
|
||||||
if params[:page_part][:module_app].blank?
|
if params[:page_part][:module_app].blank?
|
||||||
params[:page_part][:module_app] = nil
|
params[:page_part][:module_app] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:page_part][:tag].include?("nil")
|
if params[:page_part][:tag] && params[:page_part][:tag].include?("nil")
|
||||||
params[:page_part][:tag] = []
|
params[:page_part][:tag] = []
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:page_part][:category].include?("nil")
|
if params[:page_part][:category] && params[:page_part][:category].include?("nil")
|
||||||
params[:page_part][:category] = []
|
params[:page_part][:category] = []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue