Commit 72809c3ae2f7b2568756704e09dbb32e65972a59

Authored by kevin_fourie
1 parent 222d2bb9

Merged in from STABLE trunk...

KTS-3596
"Remove old search plugins when upgrading from 3.4.6 to 3.5.3"
Fixed. Added removal during upgrade.

Committed by: Kevin Fourie
Reviewed by: Megan Watson


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.3-Release-Branch@9093 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/upgrades/UpgradeFunctions.inc.php
... ... @@ -61,7 +61,7 @@ class UpgradeFunctions {
61 61 '3.1.6.3' => array('cleanupGroupMembership'),
62 62 '3.5.0' => array('cleanupOldKTAdminVersionNotifier', 'updateConfigFile35', 'registerIndexingTasks'),
63 63 '3.5.2' => array('setStorageEngine','dropForeignKeys','dropPrimaryKeys','dropIndexes','createPrimaryKeys','createForeignKeys','createIndexes', 'removeSlashesFromObjects'),
64   - '3.5.3' => array('moveConfigSettingsToDB','removeAdminVersionNotifier','addAutoIncrementToTables')
  64 + '3.5.3' => array('moveConfigSettingsToDB','removeAdminVersionNotifier','removeOldSearchPlugins','addAutoIncrementToTables')
65 65 );
66 66  
67 67 var $descriptions = array(
... ... @@ -94,6 +94,7 @@ class UpgradeFunctions {
94 94 'removeSlashesFromObjects'=>'Remove slashes from documents and folders',
95 95 'moveConfigSettingsToDB' => 'Move the configuration settings from the config.ini file into the new database table.',
96 96 'removeAdminVersionNotifier' => 'Remove the old Admin Version Notifier Plugin.',
  97 + 'removeOldSearchPlugins' => 'Remove the old Search Plugins.',
97 98 'addAutoIncrementToTables' => 'Update all db tables to use auto_increment.'
98 99 );
99 100 var $phases = array(
... ... @@ -1307,6 +1308,21 @@ class UpgradeFunctions {
1307 1308 if(file_exists($oldPath)) return rmdir($oldPath);
1308 1309 }
1309 1310 // }}}
  1311 +
  1312 + // {{{ removeOldSearchPlugins
  1313 + function removeOldSearchPlugins() {
  1314 + global $default;
  1315 + $oldPath1 = KT_DIR . "/templates/ktstandard/searchdashlet";
  1316 + if(file_exists($oldPath1)) return rmdir($oldPath1);
  1317 + $oldPath2 = KT_DIR . "/plugins/generalmetadata";
  1318 + if(file_exists($oldPath2)) return rmdir($oldPath2);
  1319 +
  1320 + $oldFile1 = KT_DIR . "/plugins/ktstandard/SearchDashletPlugin.php";
  1321 + if(file_exists($oldFile1)) return unlink($oldFile1);
  1322 + $oldFile2 = KT_DIR . "/plugins/ktstandard/SearchDashlet.php";
  1323 + if(file_exists($oldFile2)) return unlink($oldFile2);
  1324 + }
  1325 + // }}}
1310 1326 }
1311 1327  
1312 1328 ?>
... ...
sql/mysql/install/data.sql
... ... @@ -1707,9 +1707,11 @@ INSERT INTO `upgrades` VALUES
1707 1707 (192,'sql*3.5.3*0*3.5.3/db_optimizations.sql','Database optimizations.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1708 1708 (193,'sql*3.5.3*0*3.5.3/del_adminversion_plugin.sql','Remove the old Admin Version Notifier.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1709 1709 (194,'func*3.5.3*0*removeAdminVersionNotifier','Remove the old Admin Version Notifier files','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1710   -(195,'sql*3.5.3*0*3.5.3/add_autoinc.sql','Add auto increment to tables SQL.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1711   -(196,'func*3.5.3*0*addAutoIncrementToTables','Add auto increment.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1712   -(197,'upgrade*3.5.3*99*upgrade3.5.3','Upgrade from version 3.5.2 to 3.5.3','2008-03-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3');
  1710 +(195,'sql*3.5.3*0*3.5.3/del_oldsearch_plugins.sql','Remove the old Search Plugins SQL.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
  1711 +(196,'func*3.5.3*0*removeOldSearchPlugins','Remove the old Search Plugins files','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
  1712 +(197,'sql*3.5.3*0*3.5.3/add_autoinc.sql','Add auto increment to tables SQL.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
  1713 +(198,'func*3.5.3*0*addAutoIncrementToTables','Add auto increment.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
  1714 +(199,'upgrade*3.5.3*99*upgrade3.5.3','Upgrade from version 3.5.2 to 3.5.3','2008-03-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3');
1713 1715 /*!40000 ALTER TABLE `upgrades` ENABLE KEYS */;
1714 1716 UNLOCK TABLES;
1715 1717  
... ... @@ -2640,7 +2642,7 @@ UNLOCK TABLES;
2640 2642 LOCK TABLES `zseq_upgrades` WRITE;
2641 2643 /*!40000 ALTER TABLE `zseq_upgrades` DISABLE KEYS */;
2642 2644 INSERT INTO `zseq_upgrades` VALUES
2643   -(197);
  2645 +(199);
2644 2646 /*!40000 ALTER TABLE `zseq_upgrades` ENABLE KEYS */;
2645 2647 UNLOCK TABLES;
2646 2648  
... ...
sql/mysql/upgrade/3.5.3/del_oldsearch_plugins.sql 0 → 100644
  1 +-- Remove from plugins table
  2 +DELETE FROM plugins WHERE namespace = 'ktstandard.searchdashlet.plugin';
  3 +DELETE FROM plugins WHERE namespace = 'ktcore.generalmetadata.plugin';
  4 +
... ...