Skip to content

Commit

Permalink
Fix for Update Versioning Numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcordis committed Sep 24, 2024
1 parent 5e7312b commit 2a1d26a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions admin/src/Model/CwminstallModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/**
* Part of Proclaim Package
*
* @package Proclaim.Admin
* @package Proclaim.Admin
* @copyright (C) 2007 CWM Team All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link https://www.christianwebministries.org
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link https://www.christianwebministries.org
* */

namespace CWM\Component\Proclaim\Administrator\Model;
Expand Down Expand Up @@ -284,7 +284,7 @@ private function getSteps(): void
->order($this->_db->qn('id') . ' DESC');
$this->_db->setQuery($query, 0, 1);
$updates = $this->_db->loadObject();
$version = (string) $updates->version;
$version = (string)$updates->version;
$this->versionSwitch = $version;

$this->callstack['subversiontype_version'] = $version;
Expand Down Expand Up @@ -706,8 +706,8 @@ private function realRun(): bool
substr($queryString, 0, 80)
);
$queryString = ' ID:' . $queryString . ' Query count: ' . count(
$this->subQuery[$this->version][$step]
);
$this->subQuery[$this->version][$step]
);
}

Log::add(
Expand Down Expand Up @@ -956,7 +956,7 @@ private function finish(string $step): void
$update = $this->getUpdateVersion();

// Set new Schema Version
$run = $this->setSchemaVersion($update, $this->biblestudyEid);
$this->setSchemaVersion($update, $this->biblestudyEid);
$this->running = 'Update Version';
break;
case 'fixassets':
Expand Down Expand Up @@ -1058,8 +1058,13 @@ private function getUpdateVersion(): string
->from('#__bsms_update');
$this->_db->setQuery($query);
$updates = $this->_db->loadObjectList();
$return = end($updates)->version;

if (empty($return)) {
$return = BIBLESTUDY_VERSION;
}

return end($updates)->version;
return $return;
}

/**
Expand Down

0 comments on commit 2a1d26a

Please sign in to comment.