upskill-event-manager/scripts/fix-all-constants.sh
bengizmo a58ea1603c fix: Resolve duplicate initialization and jQuery selector errors
- Implement singleton pattern for HVAC_Enhanced_Settings to prevent duplicate initialization
- Fix jQuery selector error by checking for valid hash selectors before using $(href)
- Add default email templates with professional copy for trainer notifications
- Update plugin version to 1.0.1 for cache busting
- Remove duplicate Enhanced Settings initialization from HVAC_Community_Events
- Add force cache refresh suffix to admin scripts

This resolves the duplicate content issue on email templates page and fixes
JavaScript errors in the admin interface.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 17:58:39 -03:00

21 lines
No EOL
882 B
Bash
Executable file

#!/bin/bash
# Fix all undefined HVAC_CE_* constants in PHP files
echo "Fixing all undefined HVAC_CE_* constants..."
# Find all PHP files and fix constants
find . -name "*.php" -type f ! -path "./vendor/*" ! -path "./.git/*" ! -path "./node_modules/*" | while read file; do
if grep -q "HVAC_CE_" "$file"; then
echo "Fixing $file..."
# Replace HVAC_CE_PLUGIN_DIR with HVAC_PLUGIN_DIR
sed -i.bak 's/HVAC_CE_PLUGIN_DIR/HVAC_PLUGIN_DIR/g' "$file"
# Replace HVAC_CE_PLUGIN_URL with HVAC_PLUGIN_URL
sed -i.bak 's/HVAC_CE_PLUGIN_URL/HVAC_PLUGIN_URL/g' "$file"
# Replace HVAC_CE_VERSION with HVAC_PLUGIN_VERSION
sed -i.bak 's/HVAC_CE_VERSION/HVAC_PLUGIN_VERSION/g' "$file"
# Remove backup file
rm -f "$file.bak"
fi
done
echo "Done! All HVAC_CE_* constants have been replaced with HVAC_PLUGIN_* equivalents"