Fix systematic errors in pagination, sucursal warnings, and fatal count() errors across multiple modules

This commit is contained in:
2026-01-07 01:06:27 -06:00
parent aaa77e870e
commit 3a5afa82fe
354 changed files with 9022 additions and 15093 deletions

48
diagnose_docroot.php Executable file
View File

@@ -0,0 +1,48 @@
<?php
/**
* Script para detectar y arreglar el problema de DOC_ROOT
*/
echo "🔧 Diagnosticando y arreglando DOC_ROOT...\n";
// Verificar si config.php define DOC_ROOT correctamente
$configContent = file_get_contents('config.php');
if (strpos($configContent, 'defineLegacyConstants') !== false) {
echo "✅ config.php está usando defineLegacyConstants\n";
} else {
echo "❌ config.php necesita actualización manual\n";
}
// Probar carga de sistema
echo "\n🧪 Probando carga del sistema...\n";
try {
// Iniciar sesión
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Cargar sistema de configuración
require_once 'classes/system-config.class.php';
defineLegacyConstants();
echo "✅ SystemConfig cargado\n";
echo " - DOC_ROOT: " . DOC_ROOT . "\n";
echo " - WEB_ROOT: " . WEB_ROOT . "\n";
// Probar libraries.php
ob_start();
include 'libraries.php';
ob_end_clean();
echo "✅ libraries.php cargado sin errores\n";
} catch (Exception $e) {
echo "❌ Error: " . $e->getMessage() . "\n";
} catch (Error $e) {
echo "❌ Error fatal: " . $e->getMessage() . "\n";
}
echo "\n🎯 Diagnóstico completado\n";
?>