From 1a447c0bf584ecc3c1d53ab3e02adfc150e4bd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Mon, 19 Dec 2022 13:29:25 +0800 Subject: [PATCH] Fix bug. --- app/models/seminar_template_setting.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/seminar_template_setting.rb b/app/models/seminar_template_setting.rb index 56bbeb5..c9ed1a2 100644 --- a/app/models/seminar_template_setting.rb +++ b/app/models/seminar_template_setting.rb @@ -62,13 +62,16 @@ class SeminarTemplateSetting else @seminar_page_root.update(:name_translations=>@seminar.title_translations,:module=>"seminars_home",:url=>"/home",:page_id=>"home",:enabled_for=>available_locales,:bind_uid=>@seminar.uid,:bind_module_app=>"seminar",:bind_model=>"SeminarMain",:menu_enabled_for=>available_locales) if force_update end + display_menu = self.display_menu pages_info = PagesInfo relation_model = {"news" => "CustomBulletin","album"=>"CustomAlbum"} pages_info.each do |page_id , page_module| seminar_page = @seminar_page_root.child_page.where(:page_id=>page_id).first page_trans = available_locales.map{|l| [l,I18n.with_locale(l){I18n.t("seminar.menu.#{page_id}")}]}.to_h available_locales_tmp = available_locales.clone - if relation_model[page_id] + if display_menu.exclude?(page_id) + available_locales_tmp = [] + elsif relation_model[page_id] relation = relation_model[page_id].constantize rescue nil if relation if relation.where(:bind_uid=>@seminar.uid).count == 0