From 89213da0252b6dc1ad7729858d803ba579b431af Mon Sep 17 00:00:00 2001 From: lacatoire Date: Tue, 10 Feb 2026 17:20:46 +0100 Subject: [PATCH] Fix 500 error when mapping columns to None in network bulk upload When a column was mapped to None (value 0), chr(64 + 0) produced '@' which is an invalid cell coordinate for PhpSpreadsheet, causing an uncaught exception. Now fields mapped to None are set to empty string instead of attempting to read from an invalid cell address. Fixes #1040 --- bulk_network.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bulk_network.php b/bulk_network.php index b6aa9f1b3..939b88341 100644 --- a/bulk_network.php +++ b/bulk_network.php @@ -155,8 +155,12 @@ // Load up the $row[] array with the values according to the mapping supplied by the user foreach( $fields as $fname ) { - $addr = chr( 64 + $_REQUEST[$fname]); - $row[$fname] = sanitize($sheet->getCell( $addr . $n )->getValue()); + if ( $_REQUEST[$fname] == 0 ) { + $row[$fname] = ""; + } else { + $addr = chr( 64 + $_REQUEST[$fname]); + $row[$fname] = sanitize($sheet->getCell( $addr . $n )->getValue()); + } } switch( $_REQUEST["KeyField"] ) {