Awaiting feedback Import from IPB3.3, error on Polls


We are finishing our conversion to Xenforo from IPB3.3 (Yippie-Kai-Yay!)

We are using Jake Bounce's patch from here:

All fine, until polls get converted.
We hit this error:

Server Error
preg_match() expects parameter 2 to be string, array given
preg_match() in XenForo/Importer/Abstract.php at line 157
array_map() in XenForo/Importer/IPBoard.php at line 2937
XenForo_Importer_IPBoard->stepPolls() in XenForo/Importer/Abstract.php at line 77
XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 180
XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 132
XenForo_ControllerAdmin_Import->actionImport() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /mnt/data/websites/antronioforo/html/admin.php at line 13

So I went to Abstract.php line 157, and wrapped the whole if (preg_match('/[\x80-\xff]/', $string)) conditional with if(!is_array($string)) { }
Like this:
        if(!is_array($string)) {
        if (preg_match('/[\x80-\xff]/', $string))
            if (function_exists('iconv'))
                $string = @iconv($this->_charset, 'utf-8//IGNORE', $string);
            else if (function_exists('mb_convert_encoding'))
                $string = mb_convert_encoding($string, 'utf-8', $this->_charset);

After that, the importing keeps going without errors.

Hope this helps someone else.
Do you have th exact version number?


IPB seemingly keeps changing their structure for each release. One would almost think that IPB is doing so to prevent people from porting away from IPB to anything else (phpBB, vBulletin, SMF, XenForo).

Of course that's just my opinion.
I will need access to your IPB database in order to make a determination here. I can't be certain of a fix without seeing the data. Send me a PM if you are willing to give me access.
I just hit this on a test import from 3.4 at around 75% on my polls.

For now I've applied the !if 'fix' and it's continued ok.
Top Bottom