From dbac782519c49acbb68322316161ca1ff440bdce Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 9 Feb 2017 11:29:10 -0500 Subject: [PATCH] PROGMI-292 Do not display errors --- includes/utils.inc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/includes/utils.inc b/includes/utils.inc index 52d36d1..27f35e8 100644 --- a/includes/utils.inc +++ b/includes/utils.inc @@ -34,10 +34,13 @@ function kalatheme_updater_info_alter(&$updaters) { /** * Loads all dependencies necessary for Kalatheme to operate. * + * @param $display_errors + * Whether or not to display error messages when dependencies are not met. + * * @return string * Name of the function for kalatheme_status_messages to call */ -function _kalatheme_load_dependencies() { +function _kalatheme_load_dependencies($display_errors = FALSE) { // If we've already loaded dependencies, just return the correct function to // call for status messages. $dependencies_loaded = &drupal_static(__FUNCTION__); @@ -67,7 +70,7 @@ function _kalatheme_load_dependencies() { $panels = TRUE; } } - if (!$panels) { + if (!$panels && $display_errors) { drupal_set_message(t('Kalatheme requires at least Panels 3.4.'), 'error'); } @@ -82,7 +85,7 @@ function _kalatheme_load_dependencies() { $jq = TRUE; } } - if (!$jq) { + if (!$jq && $display_errors) { drupal_set_message(t('Kalatheme requires a 2.x version of JQuery Update that uses at least JQuery 1.7'), 'error'); } @@ -116,7 +119,7 @@ function _kalatheme_load_dependencies() { $boot = TRUE; } } - if (!$boot) { + if (!$boot && $display_errors) { drupal_set_message(t('You do not have a Bootstrap library installed but that is ok! To get equipped either check out our Start Up Guide or run our Setup Wizard.', array( '@setup_guide' => 'https://drupal.org/node/2167149', '@setup_url' => url('admin/appearance/kalasetup'), @@ -147,9 +150,9 @@ function kalatheme_prepare_config_form(&$form) { // Provide needed ajax wrappers $form['actions']['submit']['#prefix'] = "
"; $form['actions']['submit']['#suffix'] = "
"; - + // Add custom submit and validate functions to handle custom bootstrap - // libraries. Note that because of https://www.drupal.org/node/943212 it's + // libraries. Note that because of https://www.drupal.org/node/943212 it's // possible for this function to end up getting called before #submit exists. if (isset($form['#submit'])) { if (!in_array('kalatheme_custom_bootstrap_library_submit', $form['#submit'])) { @@ -167,11 +170,11 @@ function kalatheme_prepare_config_form(&$form) { else { $form['#submit'][] = 'kalatheme_custom_bootstrap_library_submit'; } - + if (!isset($form['#validate']) || isset($form['#validate']) && !in_array('kalatheme_custom_bootstrap_library_validate', $form['#validate'])) { $form['#validate'][] = 'kalatheme_custom_bootstrap_library_validate'; } - + return $form; } @@ -348,7 +351,7 @@ function kalatheme_backend_check() { /** * Check whether Kalatheme has write access to libraries and modules directories. * - * This check indicates whether we have enough access to be able to use + * This check indicates whether we have enough access to be able to use * authorize.php and the updater. * * @return boolean