From 1d587e19ba20a9fe990c52976514dc419959ce76 Mon Sep 17 00:00:00 2001 From: Suhyeon Hong Date: Thu, 26 Mar 2020 11:16:18 +1100 Subject: [PATCH 1/2] [GOVCMSD7-168] Fatal error caused by custom search module in PHPUnit testing --- govcms.profile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/govcms.profile b/govcms.profile index 0d2b3c26e..6e9aebd24 100644 --- a/govcms.profile +++ b/govcms.profile @@ -80,3 +80,21 @@ function govcms_paranoia_hide_modules() { 'govcms_register' => 'govCMS', ); } + +function govcms_search_core_install() { + user_role_grant_permissions( + DRUPAL_ANONYMOUS_RID, + array( + 'access search_api_page', + ) + ); + user_role_grant_permissions( + DRUPAL_AUTHENTICATED_RID, + array( + 'access search_api_page', + ) + ); + + $themes = govcms_supported_themes(); + govcms_core_insert_block('search_api_page', 'default_search', $themes, 'header', 0, 0, '', ''); +} From c757eeb852f61c5f35b88cf996b0c341ccf789fc Mon Sep 17 00:00:00 2001 From: Suhyeon Hong Date: Mon, 6 Apr 2020 10:45:22 +1000 Subject: [PATCH 2/2] update as requested --- govcms.profile | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/govcms.profile b/govcms.profile index 6e9aebd24..67a7b063c 100644 --- a/govcms.profile +++ b/govcms.profile @@ -80,21 +80,12 @@ function govcms_paranoia_hide_modules() { 'govcms_register' => 'govCMS', ); } - -function govcms_search_core_install() { - user_role_grant_permissions( - DRUPAL_ANONYMOUS_RID, - array( - 'access search_api_page', - ) - ); - user_role_grant_permissions( - DRUPAL_AUTHENTICATED_RID, - array( - 'access search_api_page', - ) +/** + * Returns a list of the themes that govCMS supports. + */ +function govcms_supported_themes() { + return array( + GOVCMS_DEFAULT_THEME, + GOVCMS_INSTALL_DEFAULT_THEME, ); - - $themes = govcms_supported_themes(); - govcms_core_insert_block('search_api_page', 'default_search', $themes, 'header', 0, 0, '', ''); }