CSV Import Error

By gversion - September 30, 2019

Here is an error I found in the log in case it helps:

E_WARNING: count(): Parameter must be an array or an object that implements Countable
/home/sites/8b/7/786382f535/public_html/cmsb/plugins/csvImport/csvImport_functions.php (line 500)

--

Thanks as always!

Greg

By daniel - September 30, 2019

Hi Greg,

It appears you're using an older version of the plugin which throws that error on systems running PHP 7. This can be fixed by either updating to the latest version of the plugin or by applying a simple patch. If you locate the following line in csvImport_functions.php (line 500):

    $maxColumnCount = max($maxColumnCount, count($colValues));

And replace it with this:

    if (!$colValues) { $done = true; break; } //If we're dealing with a blank line, skip it and stop the form analysis
    $maxColumnCount = max($maxColumnCount, count($colValues));

That should hopefully fix the error. Let me know if you have any other questions!

Thanks,

Daniel
Technical Lead
interactivetools.com

By gversion - September 30, 2019

Thanks, Daniel - I have updated the plugin and now all is working again!

Regards,

Greg