[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] update: Add a new status for patches `FAILED` and only record these as...
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <69d4ebe227429_3b190fa043c@gitlab-sidekiq-low-urgency-cpu-bound-v2-7fd4f585b8-phvjt.mail> |
Jonny Bradley pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki Commits: 56742382 by Jonny Bradley at 2026-04-07T11:34:56+00:00 [FIX] update: Add a new status for patches `FAILED` and only record these as... --- * [FIX] update: Add a new status for patches `FAILED` and only record these as... --- * [FIX] update: Add a new status for patches `FAILED` and only record these as being executed if not successful when using the `auto-register` option, instead of marking all 'NOT_APPLIED' patches as "skipped" See merge request tikiwiki/tiki!9928 (cherry picked from commit d6d0e84731fab142ccc375f90d60a6aee6b3973f) 10779425 [FIX] update: Add a new status for patches `FAILED` and only record these as... Co-authored-by: Jonny Bradley <[email protected]> See merge request tikiwiki/tiki!9962 (cherry picked from commit 5b8259fadacea003732a054d12d626c4c948d12e) 2249fcba [FIX] update: Add a new status for patches `FAILED` and only record these as... Co-authored-by: Jonny Bradley <[email protected]> - - - - - 3 changed files: - installer/Installer.php - installer/Patch.php - lib/core/Tiki/Command/UpdateCommand.php Changes: ===================================== installer/Installer.php ===================================== @@ -217,6 +217,7 @@ class Installer extends TikiDb_Bridge implements SplSubject throw new Exception('No such patch', 1); } } elseif (! $status) { + Patch::$list[$patch]->setStatus(Patch::FAILED); throw new Exception('Patch application failed', 2); } else { Patch::$list[$patch]->record(); @@ -319,9 +320,10 @@ class Installer extends TikiDb_Bridge implements SplSubject if ($throwOnError) { throw new Exception("Failed running query $statement from file $file"); } + } else { + $this->queries['executed'] += 1; } - $this->queries['executed'] += 1; $this->queries['currentStmt'] = $statement; $this->notify(); } ===================================== installer/Patch.php ===================================== @@ -19,6 +19,7 @@ class Patch public const NOT_APPLIED = 0; public const ALREADY_APPLIED = 1; public const NEWLY_APPLIED = 2; + public const FAILED = -1; private $name; private $status = null; @@ -37,7 +38,7 @@ class Patch */ public function setStatus($status) { - if (! in_array($status, [self::NOT_APPLIED, self::ALREADY_APPLIED, self::NEWLY_APPLIED])) { + if (! in_array($status, [self::NOT_APPLIED, self::ALREADY_APPLIED, self::NEWLY_APPLIED, self::FAILED])) { throw new DomainException(); } $this->status = $status; ===================================== lib/core/Tiki/Command/UpdateCommand.php ===================================== @@ -93,7 +93,7 @@ class UpdateCommand extends Command foreach (array_keys(Patch::getPatches([Patch::NEWLY_APPLIED])) as $patch) { $output->writeln("<info>Installed: $patch</info>"); } - foreach (array_keys(Patch::getPatches([Patch::NOT_APPLIED])) as $patch) { + foreach (array_keys(Patch::getPatches([Patch::FAILED])) as $patch) { $output->writeln("<error>Failed: $patch</error>"); if ($autoRegister) { View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5674238246e0e9c404715c844a266ef037502a6e -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5674238246e0e9c404715c844a266ef037502a6e You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help _______________________________________________ TikiWiki-cvs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs