- Arregla variable \$_GET["p"] con null coalescing
- Implementa paginación completa en EnumDuplicados()
- Agrega validación isset() en templates para evitar null access
- Mejora validación de entradas GET
- Corrige inicialización de variables en templates
Resuelve errores masivos y warnings en módulo de productos.
Removed BINARY keyword from LIKE clauses to allow proper comparison
between UTF-8 search terms and latin1_swedish_ci database values.
BINARY was causing exact match issues preventing search functionality.
Added BINARY keyword to LIKE clauses in Search() function to bypass
collation issues. BINARY forces byte-by-byte comparison and avoids
'Illegal mix of collations' error when connection uses utf8mb4
and table uses latin1_swedish_ci.
Removed COLLATE specification from Search() LIKE clauses to fix
'COLLATION latin1_swedish_ci is not valid for CHARACTER SET utf8mb4' error.
Let MySQL use the table's default collation for LIKE comparisons.
Added COLLATE latin1_swedish_ci to LIKE operations in Search()
function to prevent 'Illegal mix of collations' error when searching
by modelo or codigoBarra. The database uses latin1_swedish_ci but
PHP 8 uses UTF-8 encoding.
Moved $pages array initialization outside of if/else block to prevent
undefined variable warning when search returns results (if block executes).
$pages is now initialized before the conditional logic.
Fixed 'Cannot redeclare Producto::Search2()' fatal error by
removing the duplicate function at line 778. The first Search2()
function (line 664) is the correct one with proper search
functionality including JOIN with proveedor table.
Fixed 'Undefined variable $pages' error when no search criteria
are provided in Search3(), Search2(), and SearchDuplicados()
functions by initializing $pages array with proper pagination
structure in the else blocks.