Skip to content

Commit c5dc579

Browse files
committed
fix(plugin-manager): rank validation-failure status by flag, not translated text
The rank logic matched the status cell against the hardcoded English "update validation failed", but the label is translated via _(). In non-English locales the match failed and the row sorted to the bottom (rank 4) instead of the top with updates (rank 0). Track the state with a locale-independent $validation_failed flag and rank on that instead.
1 parent b83cf2f commit c5dc579

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

emhttp/plugins/dynamix.plugin.manager/include/ShowPlugins.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
// silent "up-to-date" the revert would otherwise produce (marker written by
191191
// the pre_plugin_checks hook). Common cause: the root filesystem is full so
192192
// the update files can't be downloaded for the integrity check.
193+
$validation_failed = false;
193194
if (!$os && $checked) {
194195
$invalid = "/tmp/plugins/".basename($plugin_file).".invalid";
195196
if (is_file($invalid)) {
@@ -201,14 +202,15 @@
201202
$version .= "<br><span class='red-text'>$newver</span>";
202203
$status = "<span class='warning'".($message ? " title='".htmlspecialchars($message,ENT_QUOTES)."'" : "")."><i class='fa fa-exclamation-triangle' aria-hidden='true'></i> "._('update validation failed')."</span>";
203204
if ($summary !== '') $status .= "<br><span class='orange-text' style='font-size:smaller'>".htmlspecialchars($summary,ENT_QUOTES)."</span>";
205+
$validation_failed = true;
204206
} else {
205207
@unlink($invalid);
206208
}
207209
}
208210
}
209-
if (strpos($status,'update')!==false) $rank = '0';
211+
if ($validation_failed) $rank = '0';
212+
elseif (strpos($status,'update')!==false) $rank = '0';
210213
elseif (strpos($status,'install')!==false) $rank = '1';
211-
elseif (strpos($status,'update validation failed')!==false) $rank = '0';
212214
elseif ($status=='need check') $rank = '2';
213215
elseif ($status=='up-to-date') $rank = '3';
214216
else $rank = '4';

0 commit comments

Comments
 (0)