Bool error using CSV Import version 1.17 or 1.18
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: about an hour ago (RSS)
By nmsinc - Monday at 7:18am - edited: Monday at 7:34am
I have an issue with the CSV import plugin version 1.17 or 1.18 when attempting to import a CVS file!
I removed the array function preset in the array_functions.php file when I moved to PHP version 8.5 to correct for PHP now using a preset array and I'm now receiving the following error when importing:
Warning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as arrayWarning: Cannot use bool as array
By Lucia - about an hour ago
Hi nmsinc,
This is a bug that we're aware of, and it should be fixed in an upcoming update to the plugin. However, in the meantime, here's how you can get it working.
Starting from a fresh copy of CSV Import 1.18 (https://interactivetools.com/plugins/csv-import/)
In csvImport_functions.php, on line 252, change this:
[$colValues, $offset] = _csvParser_getNextLine($csvFilepath);
to this:
$nextLine = _csvParser_getNextLine($csvFilepath);
if (!$nextLine) { break; }
[$colValues, $offset] = $nextLine;
And then on line 503, change this:
[$colValues, $offset] = _csvParser_getNextLine($csvFilepath, $setOffset);
to this:
$nextLine = _csvParser_getNextLine($csvFilepath, $setOffset);
if (!$nextLine) { $done = true; break; } // end of file
[$colValues, $offset] = $nextLine;
Let me know if you have any further issues!
Thanks,
Technical Lead
interactivetools.com