Skip to content

Commit

Permalink
[BUGFIX] #210 and #211 (#212)
Browse files Browse the repository at this point in the history
* Fix updating extension list and resetting state "is_latest" for extensions

* Minor code cleanup
  • Loading branch information
cnmarco committed Jun 23, 2022
1 parent 00c97a8 commit 2ff2283
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Classes/Service/DataIntegrity.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ protected function getLatestExtensionVersion()
->execute();
}

// set is_latest = 0 for extension versions that are not last_major_release
$queryBuilder = $connection->createQueryBuilder();
$queryBuilder->update($table)
->set('is_latest', 0)
->where('version != last_major_release')
->execute();

$queryBuilder = $connection->createQueryBuilder();
$queryBuilder->update($table)
->set('is_latest', 1)
Expand Down
6 changes: 5 additions & 1 deletion Classes/Service/Import/ExtensionImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class ExtensionImport extends BaseImport
*/
public function run()
{
$updateRequired = $this->updateExtensionList();
// $updateRequired = $this->updateExtensionList();
// always set $updateRequired = true, as $this->updateExtensionList() never returns true
$updateRequired = true;
if ($updateRequired) {
$this->insertExtensionsInCustomTable();
}
Expand Down Expand Up @@ -137,6 +139,8 @@ protected function updateExtensionList(): bool

$remoteRegistry = GeneralUtility::makeInstance(RemoteRegistry::class);
foreach ($remoteRegistry->getListableRemotes() as $remote) {
// TYPO3 11.5.12: at least TYPO3\CMS\Extensionmanager\Remote\TerExtensionRemote::getAvailablePackages()
// returns void, so $updated will never become TRUE here...
$remoteUpdate = $remote->getAvailablePackages();
if ($remoteUpdate) {
$updated = true;
Expand Down

0 comments on commit 2ff2283

Please sign in to comment.