From 9046f568382770b869da84e07859e9da7de4051e Mon Sep 17 00:00:00 2001 From: cschantz Date: Tue, 23 Dec 2025 20:53:55 -0500 Subject: [PATCH] CRITICAL FIX: system-detect.sh never loaded plesk-helpers.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root Cause: User reported "plesk_list_domains: command not found" on Plesk server. Investigation revealed system-detect.sh lines 71-72 were trying to source plesk-helpers.sh using undefined variable $LIB_DIR. The Bug: - Line 11 sets: SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - Lines 71-72 tried: if [ -f "$LIB_DIR/plesk-helpers.sh" ]; then - $LIB_DIR was NEVER defined in system-detect.sh! - Result: plesk-helpers.sh was never sourced on Plesk systems - All 31 Plesk functions were unavailable, breaking domain discovery Impact: This bug completely broke Plesk support. When launcher.sh ran on Plesk: 1. system-detect.sh detected Plesk correctly 2. But failed to load plesk-helpers.sh silently 3. reference-db.sh called list_all_domains() 4. list_all_domains() tried to call plesk_list_domains() 5. Function didn't exist → "command not found" error 6. Result: 0 domains, 0 users, 0 databases in launcher The Fix: Changed lines 71-72 from $LIB_DIR to $SCRIPT_DIR: if [ -f "$SCRIPT_DIR/plesk-helpers.sh" ]; then source "$SCRIPT_DIR/plesk-helpers.sh" fi Why This Matters: This was the REAL bug preventing Plesk support from working. All previous fixes (reference-db.sh, domain-discovery.sh) were correct but couldn't work because the foundation (plesk-helpers.sh) was never loaded. Status: CRITICAL BUG FIXED - Ready for Plesk testing --- lib/system-detect.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/system-detect.sh b/lib/system-detect.sh index 51f47ff..310362e 100755 --- a/lib/system-detect.sh +++ b/lib/system-detect.sh @@ -68,8 +68,8 @@ detect_control_panel() { SYS_LOG_DIR="/var/www/vhosts/system" # Source Plesk helpers for advanced functionality - if [ -f "$LIB_DIR/plesk-helpers.sh" ]; then - source "$LIB_DIR/plesk-helpers.sh" + if [ -f "$SCRIPT_DIR/plesk-helpers.sh" ]; then + source "$SCRIPT_DIR/plesk-helpers.sh" fi print_success "Detected Plesk v${SYS_CONTROL_PANEL_VERSION}"