diff options
author | Oliver Schramm <oliver.schramm97@gmail.com> | 2016-08-11 13:31:23 +0200 |
---|---|---|
committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2016-08-11 13:31:23 +0200 |
commit | 6078bae7f8888f6c1d8bdc9a409b3e0a9cb3cc49 (patch) | |
tree | cffd62b9fbc3d3ad706e6158af97c5159704d8cc /phpBB/phpbb/db/migrator.php | |
parent | 2ee8bd0c4a0379961c7ec00376c216822672057f (diff) | |
download | forums-6078bae7f8888f6c1d8bdc9a409b3e0a9cb3cc49.tar forums-6078bae7f8888f6c1d8bdc9a409b3e0a9cb3cc49.tar.gz forums-6078bae7f8888f6c1d8bdc9a409b3e0a9cb3cc49.tar.bz2 forums-6078bae7f8888f6c1d8bdc9a409b3e0a9cb3cc49.tar.xz forums-6078bae7f8888f6c1d8bdc9a409b3e0a9cb3cc49.zip |
[ticket/14742] Fix schema update
First make it work, then avoid a loop
PHPBB3-14742
Diffstat (limited to 'phpBB/phpbb/db/migrator.php')
-rw-r--r-- | phpBB/phpbb/db/migrator.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 8637f71414..aaa7769cee 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -470,6 +470,9 @@ class migrator $steps = array_reverse($steps); } + end($steps); + $last_step_identifier = key($steps); + foreach ($steps as $step_identifier => $step) { $last_result = 0; @@ -486,6 +489,12 @@ class migrator // Set state to false since we reached the point we were at $state = false; + + // There is a programmed tendency to get stuck in this case + if (strpos($step[0], 'dbtools') === 0 && ($last_result === null || $last_result === true)) + { + continue; + } } try @@ -494,7 +503,8 @@ class migrator // After any schema update step we allow to pause, since // database changes can take quite some time $result = $this->run_step($step, $last_result, $revert); - if ($result !== null && $result !== true && strpos($step[0], 'dbtools') !== 0) + if (($result !== null && $result !== true) || + (strpos($step[0], 'dbtools') === 0 && $step_identifier !== $last_step_identifier)) { return serialize(array( 'result' => $result, |