From eb638995f0cdd24ef0f8888d96f53dc7cc4a4c7c Mon Sep 17 00:00:00 2001 From: Bernie Chiu Date: Fri, 13 Dec 2013 15:39:19 +0800 Subject: [PATCH] Fix missing params category value --- app/controllers/admin/page_parts_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 605b3419..74377fa1 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -103,6 +103,8 @@ class Admin::PagePartsController < OrbitBackendController def update @part = PagePart.find(params[:id]) + # Sometimes category is passed into params[:page], so this line makes sure it will also be in params[:page_part] too + params[:page_part][:category] ||= params[:page][:category] if @part.update_attributes(params[:page_part]) set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu') flash.now[:notice] = t('update.success.content')