diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 2a5bf861b938ea9a0c1342436c90e54b274f8df1..170d69ba4b0b0120b92cb4eed3e45bcc56f5724b 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -150,8 +150,9 @@ $staticRoutes = array( 'Search/Suggest', 'Summon/Advanced', 'Summon/Home', 'Summon/Search', 'Tag/Home', - 'Upgrade/Home', 'Upgrade/FixAnonymousTags', 'Upgrade/FixMetadata', - 'Upgrade/GetDBCredentials', 'Upgrade/GetSourceDir', 'Upgrade/Reset', + 'Upgrade/Home', 'Upgrade/FixAnonymousTags', 'Upgrade/FixConfig', + 'Upgrade/FixDatabase', 'Upgrade/FixMetadata', 'Upgrade/GetDBCredentials', + 'Upgrade/GetSourceDir', 'Upgrade/Reset', 'Worldcat/Advanced', 'Worldcat/Home', 'Worldcat/Search' ); diff --git a/module/VuFind/src/VuFind/Controller/UpgradeController.php b/module/VuFind/src/VuFind/Controller/UpgradeController.php index c22cc5f35e8db26f94d5b471def41eaff879766d..955aabf0330138b29ff3abca35789e435552a284 100644 --- a/module/VuFind/src/VuFind/Controller/UpgradeController.php +++ b/module/VuFind/src/VuFind/Controller/UpgradeController.php @@ -27,7 +27,7 @@ */ namespace VuFind\Controller; use ArrayObject, VuFind\Cache\Manager as CacheManager, - VuFind\Cookie\Container as CookieContainer, + VuFind\Config\Reader as ConfigReader, VuFind\Cookie\Container as CookieContainer, VuFind\Db\Table\Resource as ResourceTable, VuFind\Exception\RecordMissing as RecordMissingException, VuFind\Record, Zend\Session\Container as SessionContainer; @@ -140,12 +140,11 @@ class UpgradeController extends AbstractBase */ public function fixconfigAction() { - /* TODO - $upgrader = new VF_Config_Upgrade( + $upgrader = new \VuFind\Config\Upgrade( $this->cookie->oldVersion, $this->cookie->newVersion, $this->cookie->sourceDir . '/web/conf', - APPLICATION_PATH . '/configs', - LOCAL_OVERRIDE_DIR . '/application/configs' + dirname(ConfigReader::getBaseConfigPath('config.ini')), + dirname(ConfigReader::getLocalConfigPath('config.ini', null, true)) ); try { $upgrader->run(); @@ -153,13 +152,12 @@ class UpgradeController extends AbstractBase $this->cookie->configOkay = true; return $this->forwardTo('Upgrade', 'Home'); } catch (\Exception $e) { - $extra = is_a($e, 'VF_Exception_FileAccess') + $extra = is_a($e, 'VuFind\Exception\FileAccess') ? ' Check file permissions.' : ''; $this->flashMessenger()->setNamespace('error') ->addMessage('Config upgrade failed: ' . $e->getMessage() . $extra); return $this->forwardTo('Upgrade', 'Error'); } - */ } /** @@ -419,12 +417,12 @@ class UpgradeController extends AbstractBase return $this->forwardTo('Upgrade', 'EstablishVersions'); } - /* TODO // Now make sure we have a configuration file ready: if (!isset($this->cookie->configOkay)) { return $this->redirect()->toRoute('upgrade-fixconfig'); } + /* TODO // Now make sure the database is up to date: if (!isset($this->cookie->databaseOkay)) { return $this->redirect()->toRoute('upgrade-fixdatabase'); @@ -449,7 +447,14 @@ class UpgradeController extends AbstractBase ->addMessage($warning); } - return $this->createViewModel(); + return $this->createViewModel( + array( + 'configDir' => dirname( + ConfigReader::getLocalConfigPath('config.ini', null, true) + ), + 'importDir' => LOCAL_OVERRIDE_DIR . '/import' + ) + ); } /** diff --git a/themes/blueprint/templates/upgrade/home.phtml b/themes/blueprint/templates/upgrade/home.phtml index fb7b36f0b06d0da42f6770c71adb56962ee32ed7..7672a6232444e770c44583d2a3a8ec363f474994 100644 --- a/themes/blueprint/templates/upgrade/home.phtml +++ b/themes/blueprint/templates/upgrade/home.phtml @@ -10,8 +10,8 @@ <p>Upgrade complete. You may still have some work to do:</p> <ol> - <li>If you have customized your SolrMarc import settings, we have migrated your marc_local.properties file, but you will need to move custom translation maps, index scripts, etc. by hand. Custom import files belong under <?=$this->escapeHtml(LOCAL_OVERRIDE_DIR)?>/import -- this will make future upgrades easier.</li> - <li>You should look over the configuration files in <?=$this->escapeHtml(LOCAL_OVERRIDE_DIR)?>/application/configs and make sure settings look correct. The automatic update process sometimes re-enables disabled settings and removes comments.</li> + <li>If you have customized your SolrMarc import settings, your marc_local.properties file has been migrated, but you will need to move custom translation maps, index scripts, etc. by hand. Custom import files belong under <?=$this->escapeHtml($this->importDir)?> -- this will make future upgrades easier.</li> + <li>You should look over the configuration files in <?=$this->escapeHtml($this->configDir)?> and make sure settings look correct. The automatic update process sometimes re-enables disabled settings and removes comments.</li> <li>If you have customized any of the YAML searchspecs files without using the *_local.yaml override mechanism, you will need to reapply those changes.</li> <li>If you have customized code or templates in your previous version, you will need to adapt those changes to the new architecture.</li> <li>You should reindex all of your content.</li>