From f67116980d4bbe852557c942099c0d3132eb6689 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 7 Apr 2017 11:27:01 +0200 Subject: [PATCH] If gcse settings are not set, do not generate the gcse search form. --- modules/google_search_20/src/google_custom_search_module_20.e | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/google_search_20/src/google_custom_search_module_20.e b/modules/google_search_20/src/google_custom_search_module_20.e index 2c85e12..5338dd3 100644 --- a/modules/google_search_20/src/google_custom_search_module_20.e +++ b/modules/google_search_20/src/google_custom_search_module_20.e @@ -130,7 +130,7 @@ feature -- Hooks configuration get_block_view (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE) do if a_block_id.is_case_insensitive_equal_general ("gcse_search_form") then - if a_response.request.is_get_request_method then + if attached gcse_cx_key (a_response.api) as cx then if attached smarty_template_block (Current, a_block_id, a_response.api) as l_tpl_block then a_response.add_block (l_tpl_block, "search") else @@ -138,6 +138,8 @@ feature -- Hooks configuration a_response.add_warning_message ("Error with block [" + a_block_id + "]") end end + else + -- missing setting. end end end