Fixed SMF Importer "non-numeric value encountered" error

Brettflan

Active member
Affected version
1.5.16a
I'm currently doing a test import of a huge SMF forum (6.3m posts), importing into XF 1.5.16a, and I ran into an error during the "Import Threads and Posts" step which prevented me from continuing forward. Apologies, I no longer have the full stack trace available since I put in my own workaround, but I can provide most details on the cause and that workaround. The error was "non-numeric value encountered" on line 2120 of /Xenforo/Importer/SMF.php, specifically:
PHP:
                $size = round($size * 1.333333);

Apparently $size which had been passed on was non-numeric text.
My simple workaround was to add this above at line 2116:
PHP:
                $size = (is_numeric($size)) ? $size : 1;

I'm not sure whether this would still be a problem with your upcoming XF 2.0 version of the SMF importer or not. As an aside, I am looking forward to the SMF importer for XF 2.0; we plan to migrate our forum over from SMF to XF 2.0 in the near future, and it would greatly simplify things if I can do that directly instead of needing to go to XF 1.5 first.
 
Top Bottom