Skip to content

Commit

Permalink
Fix for MODX updates widget (#16694)
Browse files Browse the repository at this point in the history
### What does it do?
Fixes error in array selection when only one update is available.

### Why is it needed?
MODX update status is not showing properly (both when there is an update
and when MODX _is_ up to date) when the software update API only returns
one option.

### How to test

1. Verify software status displays "Up to Date" on this dev branch
2. Manually apply this change on the 3.0.x branch to verify the 3.1.0
update shows and is downloadable via the widget

### Related issue(s)/PR(s)
None
  • Loading branch information
smg6511 authored and opengeek committed Jan 24, 2025
1 parent e971288 commit 9fa6588
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/Revolution/Processors/SoftwareUpdate/GetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function getModxUpdates(): array
$upgradesCount = count($upgrades);
if ($upgradesCount === 1) {
$categoryData['updateable'] = 1;
$selectedUpgrade = $upgrades;
$selectedUpgrade = $upgrades[array_key_first($upgrades)];
} else {
foreach ($upgrades as $upgrade) {
$selectedUpgrade = $upgrade;
Expand Down

0 comments on commit 9fa6588

Please sign in to comment.