diff --git a/config/vufind/config.ini b/config/vufind/config.ini index 051a44dd400e19825092a3bb8943434985a0b868..dcde05811055f6c7a48843fc7c9aedf2650e7eaa 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -413,17 +413,6 @@ url = "http://syndetics.com" url = "http://contentcafe2.btol.com" pw = "Password" -; Web Search is Optional. The Web Search is powered by Google. -; To use enter your Google Web Search key and the domain the of your library -; website. -; The side_recommend setting is used to load recommendations modules; see -; searches.ini for a list of options (though not all will work in this context). -; You can set it to false if you do not want to display any recommendations. -;[GoogleSearch] -;key = MyGoogleSearchKey -;domain = library.myuniversity.edu -;side_recommend[] = CatalogResults:lookfor - ; Summon is Optional. See also the separate Summon.ini file. ;[Summon] ;apiId = myAccessId diff --git a/module/VuFind/src/VuFind/Config/Upgrade.php b/module/VuFind/src/VuFind/Config/Upgrade.php index af2abde59d038724530f846024ae114e531fcdd2..95a86bee202ca759ce8684e781c36f3c96fbf3c8 100644 --- a/module/VuFind/src/VuFind/Config/Upgrade.php +++ b/module/VuFind/src/VuFind/Config/Upgrade.php @@ -109,6 +109,18 @@ class Upgrade return $this->warnings; } + /** + * Add a warning message. + * + * @param string $msg Warning message. + * + * @return void + */ + protected function addWarning($msg) + { + $this->warnings[] = $msg; + } + /** * Support function -- merge the contents of two arrays parsed from ini files. * @@ -313,10 +325,12 @@ class Upgrade if (!file_exists(APPLICATION_PATH . '/themes/' . $theme) || !is_dir(APPLICATION_PATH . '/themes/' . $theme) ) { - $this->warnings[] = "WARNING: This version of VuFind does not support " + $this->addWarning( + "WARNING: This version of VuFind does not support " . "the {$theme} theme. Your config.ini [Site] {$setting} setting " . "has been reset to the default: {$default}. You may need to " - . "reimplement your custom theme."; + . "reimplement your custom theme." + ); $this->newConfigs['config.ini']['Site'][$setting] = $default; } } @@ -357,19 +371,30 @@ class Upgrade && stristr($newConfig['Content']['coverimages'], 'amazon'); if ($hasAmazonReview || $hasAmazonCover) { if (!isset($newConfig['Content']['amazonsecret'])) { - $this->warnings[] - = 'WARNING: You have Amazon content enabled but are missing ' + $this->addWarning( + 'WARNING: You have Amazon content enabled but are missing ' . 'the required amazonsecret setting in the [Content] section ' - . 'of config.ini'; + . 'of config.ini' + ); } if (!isset($newConfig['Content']['amazonassociate'])) { - $this->warnings[] - = 'WARNING: You have Amazon content enabled but are missing ' + $this->addWarning( + 'WARNING: You have Amazon content enabled but are missing ' . 'the required amazonassociate setting in the [Content] section' - . ' of config.ini'; + . ' of config.ini' + ); } } + // Warn the user if they have enabled a deprecated Google API: + if (isset($newConfig['GoogleSearch'])) { + unset($newConfig['GoogleSearch']); + $this->addWarning( + 'The [GoogleSearch] section of config.ini is no ' + . 'longer supported due to changes in Google APIs.' + ); + } + // Warn the user if they are using an unsupported theme: $this->checkTheme('theme', 'blueprint'); $this->checkTheme('mobile_theme', 'jquerymobile'); @@ -684,10 +709,12 @@ class Upgrade $driver = isset($this->newConfigs['config.ini']['Catalog']['driver']) ? $this->newConfigs['config.ini']['Catalog']['driver'] : ''; if (empty($driver)) { - $this->warnings[] = "WARNING: Could not find ILS driver setting."; + $this->addWarning("WARNING: Could not find ILS driver setting."); } else if (!file_exists($this->oldDir . '/' . $driver . '.ini')) { - $this->warnings[] = "WARNING: Could not find {$driver}.ini file; " - . "check your ILS driver configuration."; + $this->addWarning( + "WARNING: Could not find {$driver}.ini file; " + . "check your ILS driver configuration." + ); } else { $this->saveUnmodifiedConfig($driver . '.ini'); }