Skip to content

Commit b23f246

Browse files
authored
Merge pull request #64 from ggoffy/master
adapted update due to new semantic versioning
2 parents 0543270 + 28838e7 commit b23f246

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- update to php8 (goffy)
1212
- replaced Common/XoopsConfirm by Common/Confirm (mamba/goffy)
1313
- uninstall with bak-file creation (mamba/goffy)
14+
- adapted update due to new semantic versioning (goffy)
1415

1516
===================================================================
1617
2021/03/31 Version 1.04 RC1

include/update.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ function xoops_module_update_wggithub($module, $prev_version = null)
7676
//$migrate->setDefinitionFile('update_' . $moduleDirName);
7777
//} catch (\Exception $e) {
7878
// as long as this is not done default file has to be created
79-
$moduleVersion = $module->getInfo('version');
80-
$fileYaml = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/sql/{$moduleDirName}_{$moduleVersion}_migrate.yml";
79+
$moduleVersionOld = $module->getInfo('version');
80+
$moduleVersionNew = \str_replace(['.', '-'], '_', $moduleVersionOld);
81+
$fileYaml = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/sql/{$moduleDirName}_{$moduleVersionNew}_migrate.yml";
8182
//}
8283

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

91+
//create copy for XOOPS 2.5.11 Beta 1 and older versions
92+
$fileYaml2 = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/sql/{$moduleDirName}_{$moduleVersionOld}_migrate.yml";
93+
\copy($fileYaml, $fileYaml2);
94+
9095
// run standard procedure for db migration
9196
$migrate->synchronizeSchema();
9297

0 commit comments

Comments
 (0)