Skip to content

Commit 53fc5f6

Browse files
authored
Merge pull request #299 from drupalprojects/no-errors
PROGMI-292 Do not display errors
2 parents d6bc92d + dbac782 commit 53fc5f6

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

includes/utils.inc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ function kalatheme_updater_info_alter(&$updaters) {
3434
/**
3535
* Loads all dependencies necessary for Kalatheme to operate.
3636
*
37+
* @param $display_errors
38+
* Whether or not to display error messages when dependencies are not met.
39+
*
3740
* @return string
3841
* Name of the function for kalatheme_status_messages to call
3942
*/
40-
function _kalatheme_load_dependencies() {
43+
function _kalatheme_load_dependencies($display_errors = FALSE) {
4144
// If we've already loaded dependencies, just return the correct function to
4245
// call for status messages.
4346
$dependencies_loaded = &drupal_static(__FUNCTION__);
@@ -67,7 +70,7 @@ function _kalatheme_load_dependencies() {
6770
$panels = TRUE;
6871
}
6972
}
70-
if (!$panels) {
73+
if (!$panels && $display_errors) {
7174
drupal_set_message(t('Kalatheme requires at least Panels 3.4.'), 'error');
7275
}
7376

@@ -82,7 +85,7 @@ function _kalatheme_load_dependencies() {
8285
$jq = TRUE;
8386
}
8487
}
85-
if (!$jq) {
88+
if (!$jq && $display_errors) {
8689
drupal_set_message(t('Kalatheme requires a 2.x version of JQuery Update that uses at least JQuery 1.7'), 'error');
8790
}
8891

@@ -116,7 +119,7 @@ function _kalatheme_load_dependencies() {
116119
$boot = TRUE;
117120
}
118121
}
119-
if (!$boot) {
122+
if (!$boot && $display_errors) {
120123
drupal_set_message(t('You do not have a Bootstrap library installed but that is ok! To get equipped either check out our <a href="@setup_guide">Start Up Guide</a> or run our <a href="@setup_url">Setup Wizard.</a>', array(
121124
'@setup_guide' => 'https://drupal.org/node/2167149',
122125
'@setup_url' => url('admin/appearance/kalasetup'),
@@ -147,9 +150,9 @@ function kalatheme_prepare_config_form(&$form) {
147150
// Provide needed ajax wrappers
148151
$form['actions']['submit']['#prefix'] = "<div id='kala-submit-change-title'>";
149152
$form['actions']['submit']['#suffix'] = "</div>";
150-
153+
151154
// Add custom submit and validate functions to handle custom bootstrap
152-
// libraries. Note that because of https://www.drupal.org/node/943212 it's
155+
// libraries. Note that because of https://www.drupal.org/node/943212 it's
153156
// possible for this function to end up getting called before #submit exists.
154157
if (isset($form['#submit'])) {
155158
if (!in_array('kalatheme_custom_bootstrap_library_submit', $form['#submit'])) {
@@ -167,11 +170,11 @@ function kalatheme_prepare_config_form(&$form) {
167170
else {
168171
$form['#submit'][] = 'kalatheme_custom_bootstrap_library_submit';
169172
}
170-
173+
171174
if (!isset($form['#validate']) || isset($form['#validate']) && !in_array('kalatheme_custom_bootstrap_library_validate', $form['#validate'])) {
172175
$form['#validate'][] = 'kalatheme_custom_bootstrap_library_validate';
173176
}
174-
177+
175178
return $form;
176179
}
177180

@@ -348,7 +351,7 @@ function kalatheme_backend_check() {
348351
/**
349352
* Check whether Kalatheme has write access to libraries and modules directories.
350353
*
351-
* This check indicates whether we have enough access to be able to use
354+
* This check indicates whether we have enough access to be able to use
352355
* authorize.php and the updater.
353356
*
354357
* @return boolean

0 commit comments

Comments
 (0)