Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
*6076* Plug-In version entries are not properly being installed/updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrandel committed Oct 29, 2010
1 parent 77106be commit c3d8534
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 54 deletions.
23 changes: 0 additions & 23 deletions classes/install/Install.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,29 +111,6 @@ function createData() {
// Install the schema aliases
$schemaAliasDao =& DAORegistry::getDAO('SchemaAliasDAO');
$schemaAliasDao->installSchemaAliases();

// Add initial plugin data to versions table
$versionDao =& DAORegistry::getDAO('VersionDAO');
import('lib.pkp.classes.site.VersionCheck');
$categories = PluginRegistry::getCategories();
foreach ($categories as $category) {
PluginRegistry::loadCategory($category);
$plugins = PluginRegistry::getPlugins($category);
foreach ($plugins as $plugin) {
$versionFile = $plugin->getPluginPath() . '/version.xml';

if (FileManager::fileExists($versionFile)) {
$versionInfo =& VersionCheck::parseVersionXML($versionFile);
$pluginVersion = $versionInfo['version'];
} else {
$pluginVersion = new Version(
1, 0, 0, 0, Core::getCurrentDate(), 1,
'plugins.'.$category, basename($plugin->getPluginPath()), '', 0, $plugin->isSitePlugin()
);
}
$versionDao->insertVersion($pluginVersion, true);
}
}
}

return true;
Expand Down
30 changes: 0 additions & 30 deletions classes/install/Upgrade.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,36 +115,6 @@ function installSchemaAliases() {
$schemaAliasDao->installSchemaAliases();
return true;
}

/**
* For 2.3 upgrade: Add initial plugin data to versions table
* @return boolean
*/
function addPluginVersions() {
$versionDao =& DAORegistry::getDAO('VersionDAO');
import('lib.pkp.classes.site.VersionCheck');
$categories = PluginRegistry::getCategories();
foreach ($categories as $category) {
PluginRegistry::loadCategory($category);
$plugins = PluginRegistry::getPlugins($category);
if (is_array($plugins)) foreach ($plugins as $plugin) {
$versionFile = $plugin->getPluginPath() . '/version.xml';

if (FileManager::fileExists($versionFile)) {
$versionInfo =& VersionCheck::parseVersionXML($versionFile);
$pluginVersion = $versionInfo['version'];
} else {
$pluginVersion = new Version(
1, 0, 0, 0, Core::getCurrentDate(), 1,
'plugins.'.$category, basename($plugin->getPluginPath()), '', 0, $plugin->isSitePlugin()
);
}
$versionDao->insertVersion($pluginVersion, true);
}
}

return true;
}
}

?>
1 change: 1 addition & 0 deletions dbscripts/xml/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
<data file="dbscripts/xml/data/locale/{$installedLocale}/email_templates_data.xml" />
<code function="createData" />
<code function="createConfig" />
<code function="addPluginVersions"/>
</install>
4 changes: 3 additions & 1 deletion dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@

<upgrade minversion="2.0.0.0" maxversion="2.3.1.0">
<data file="dbscripts/xml/upgrade/2.3.1_update.xml" />
<code function="addPluginVersions" />
<code function="clearDataCache" />
<note file="docs/release-notes/README-2.3.1" />
</upgrade>

<!-- update plugin configuration - should be done as the final upgrade task -->
<code function="addPluginVersions" />
</install>

0 comments on commit c3d8534

Please sign in to comment.