Fix nag detection: PVE 9 effectively disabled the subscription popup

PVE 9.1 changed the JS condition to check for 'NoMoreNagging' status
(case-sensitive compare after toLowerCase), which never matches. The
subscription API returns status "notfound" which is truthy, so the
nag dialog condition is always false. Detect PVE major version and
skip nag check for PVE >= 9.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maarten 2026-03-02 16:53:32 +01:00
parent a7eb09e248
commit 9a87261823
1 changed files with 11 additions and 5 deletions

View File

@ -419,11 +419,17 @@ if grep -rq 'pve-no-subscription' /etc/apt/sources.list.d/ 2>/dev/null; then
fi fi
echo "$nosub" echo "$nosub"
echo '---NAG_PATCHED---' echo '---NAG_PATCHED---'
# Check if the subscription nag popup has been patched # Check if the subscription nag popup needs patching.
# PVE 8: void({ replaces Ext.Msg.show # PVE 9.x changed the JS logic so the nag never triggers even without
# PVE 9: same pattern or similar # patching (the condition checks for 'NoMoreNagging' which never matches).
if grep -q 'void({' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then # PVE 8.x needs the void({ patch to suppress it.
echo 'yes' pve_major=$(pvesh get /version --output-format json 2>/dev/null \
| python3 -c 'import sys,json; print(json.load(sys.stdin)["version"].split(".")[0])' 2>/dev/null \
|| echo '8')
if [ "$pve_major" -ge 9 ] 2>/dev/null; then
echo 'yes' # PVE 9+ nag is effectively disabled
elif grep -q 'void({' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then
echo 'yes' # PVE 8 with JS patch applied
elif ! grep -q "No valid subscription" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then elif ! grep -q "No valid subscription" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2>/dev/null; then
echo 'yes' # nag text removed entirely echo 'yes' # nag text removed entirely
else else