CRITICAL FIX: system-detect.sh never loaded plesk-helpers.sh

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
This commit is contained in:
cschantz
2025-12-23 20:53:55 -05:00
parent 3398e66744
commit 9046f56838
+2 -2
View File
@@ -68,8 +68,8 @@ detect_control_panel() {
SYS_LOG_DIR="/var/www/vhosts/system" SYS_LOG_DIR="/var/www/vhosts/system"
# Source Plesk helpers for advanced functionality # Source Plesk helpers for advanced functionality
if [ -f "$LIB_DIR/plesk-helpers.sh" ]; then if [ -f "$SCRIPT_DIR/plesk-helpers.sh" ]; then
source "$LIB_DIR/plesk-helpers.sh" source "$SCRIPT_DIR/plesk-helpers.sh"
fi fi
print_success "Detected Plesk v${SYS_CONTROL_PANEL_VERSION}" print_success "Detected Plesk v${SYS_CONTROL_PANEL_VERSION}"