Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- update to php8 (goffy)
- replaced Common/XoopsConfirm by Common/Confirm (mamba/goffy)
- uninstall with bak-file creation (mamba/goffy)
- adapted update due to new semantic versioning (goffy)

===================================================================
2021/03/31 Version 1.04 RC1
Expand Down
9 changes: 7 additions & 2 deletions include/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ function xoops_module_update_wggithub($module, $prev_version = null)
//$migrate->setDefinitionFile('update_' . $moduleDirName);
//} catch (\Exception $e) {
// as long as this is not done default file has to be created
$moduleVersion = $module->getInfo('version');
$fileYaml = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/sql/{$moduleDirName}_{$moduleVersion}_migrate.yml";
$moduleVersionOld = $module->getInfo('version');
$moduleVersionNew = \str_replace(['.', '-'], '_', $moduleVersionOld);
$fileYaml = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/sql/{$moduleDirName}_{$moduleVersionNew}_migrate.yml";
//}

// create a schema file based on sql/mysql.sql
Expand All @@ -87,6 +88,10 @@ function xoops_module_update_wggithub($module, $prev_version = null)
return false;
}

//create copy for XOOPS 2.5.11 Beta 1 and older versions
$fileYaml2 = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/sql/{$moduleDirName}_{$moduleVersionOld}_migrate.yml";
\copy($fileYaml, $fileYaml2);

// run standard procedure for db migration
$migrate->synchronizeSchema();

Expand Down