Project

General

Profile

Bug #24388 » 16926_v3.diff

Administrator Admin, 2011-01-18 18:06

View differences:

typo3/sysext/install/updates/class.tx_coreupdates_migrateworkspaces.php (working copy)
$this->includeTCA();
// install version and workspace extension (especially when updating from very old TYPO3 versions
$this->installExtensions(array('extbase', 'fluid', 'version', 'workspaces'));
$this->installNecessaryExtensions(array('extbase', 'fluid', 'version', 'workspaces'));
// migrate all workspaces to support groups and be_users
if ($this->isOldStyleAdminFieldUsed()) {
......
}
/**
* Install a extensions
* Install extensions required for a complete workspaces setup
*
* @param array List of extension keys
* @return boolean Determines whether this was successful or not
* @param array $extensionKeys List of extension keys
* @return void
*/
protected function installExtensions($extensionKeys) {
if (!is_array($extensionKeys)) {
return FALSE;
protected function installNecessaryExtensions(array $extensionKeys) {
// Install all necessary extensions
foreach ($extensionKeys as $extension) {
$this->installExtension($extension);
}
// Perform the related database updates
$this->runNewExtensionDbUpdates($extensionKeys);
}
$result = FALSE;
$extList = $this->addExtToList($extensionKeys);
if ($extList) {
$this->writeNewExtensionList($extList);
$result = TRUE;
/**
* Performing all relevant database updates for the newly installed system extensions
*
* @param array $extensionKeys
* @return void
*/
protected function runNewExtensionDbUpdates($extensionKeys) {
$install = t3lib_div::makeInstance('t3lib_install');
foreach ($extensionKeys as $extension) {
$filename = t3lib_extMgm::extPath($extension, 'ext_tables.sql');
if (!is_readable($filename)) {
continue;
}
$fileContent = t3lib_div::getUrl($filename);
$fieldDefinitionsFromFile = $install->getFieldDefinitions_fileContent($fileContent);
if (count($fieldDefinitionsFromFile)) {
$fieldDefinitionsForCurrentDb = $install->getFieldDefinitions_database(TYPO3_db);
$diff = $install->getDatabaseExtra($fieldDefinitionsFromFile, $fieldDefinitionsForCurrentDb);
$updates = $install->getUpdateSuggestions($diff);
foreach ($updates as $key => $update_block) {
// make sure only certain blocks are processed
// we don't want to delete anything here!
if (!in_array($key, array('add', 'change', 'create_table'))) {
continue;
}
foreach ($update_block as $update) {
$this->sqlQueries[] = $update;
$GLOBALS['TYPO3_DB']->admin_query($update);
}
}
}
}
return $result;
}
/**
(2-2/3)