• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed  IP.Board importer error.

Mikey

Well-known member
#1
Figured that I'd report this bug. I was importing the users, checked to find the gravatar, clicked go, and this happened..

Code:
Server Error

Undefined offset: 0

XenForo_Application::handlePhpError() in XenForo/Importer/IPBoard.php at line 1047
XenForo_Importer_IPBoard->_getGroupsForUser() in XenForo/Importer/IPBoard.php at line 1111
XenForo_Importer_IPBoard->_isAdmin() in XenForo/Importer/IPBoard.php at line 846
XenForo_Importer_IPBoard->_importUser() in XenForo/Importer/IPBoard.php at line 721
XenForo_Importer_IPBoard->_importOrMergeUser() in XenForo/Importer/IPBoard.php at line 512
XenForo_Importer_IPBoard->stepUsers() in XenForo/Importer/Abstract.php at line 77
XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 166
XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 118
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 /home/xenforo/public_html/admin.php at line 13
Refresh didn't fix it..
 

Mikey

Well-known member
#3
Thanks. I also tried starting over and not ticking any of the boxes, same error.

It's worth noting that this database has been through a lot. I've imported some vBulletin data from a different community (via ImpEx), also imported a XenForo community into it (using the IP.Board converters they offer customers). I don't know if that changes anything but thought it may help.
 

Kier

XenForo Developer
Staff member
#4
Any chance I can get a look at your database? I've just reproduced your steps here with several test databases and none have blown up.
 

Mikey

Well-known member
#6
FWIW it looks like you have a user with member_group_id = 0, which would be invalid.
That looks to be the problem..
Code:
SELECT * FROM  `members` WHERE  `member_group_id` =  '0' LIMIT 0 , 30
Showing rows 0 - 29 (96 total, Query took 0.0010 sec)
They're possibly a result of the ImpEx or another conversion into the db. I'll update those to the valid member group ID and try the import again. Thanks Kier
 

Kier

XenForo Developer
Staff member
#7
That looks to be the problem..
Code:
SELECT * FROM  `members` WHERE  `member_group_id` =  '0' LIMIT 0 , 30
Showing rows 0 - 29 (96 total, Query took 0.0010 sec)
They're possibly a result of the ImpEx or another conversion into the db. I'll update those to the valid member group ID and try the import again. Thanks Kier
Are you able to say where those users came from? Do they look like members, or are they dead remnants of something that went wrong a long time ago?
 

Mikey

Well-known member
#8
Are you able to say where those users came from? Do they look like members, or are they dead remnants of something that went wrong a long time ago?
The users were from the XenForo > IP.Board converter I used, at the time the IPS staff let me use it as a beta stage, I reported all the bugs to them, but I guess the remnants were just there. It seems to have fixed it when I ran the update query on the db, so this is possibly an isolated incident.
 

Mikey

Well-known member
#9

Everything is imported now that I ran the update query. Seems to have just been an odd error from remnants of the past imports

For anyone interested the query I ran was
Code:
UPDATE `tblprefix_members` SET `member_group_id` = '3' WHERE `member_group_id` = '0'
Just in case anyone has a similar issue and finds this thread in a search.. You can mark this as fixed now, as it wasn't really a bug :p

Thanks Kier :)
 

Kier

XenForo Developer
Staff member
#10
I'm wondering what to do about this should the importer encounter it. Strictly speaking, a user with a member_group_id of 0 is not valid, so we could consider it damaged data and skip that user entirely... or we could just plonk them into group 3 (members) as Mikey did.

Any thoughts?
 

Mikey

Well-known member
#12
I'm wondering what to do about this should the importer encounter it. Strictly speaking, a user with a member_group_id of 0 is not valid, so we could consider it damaged data and skip that user entirely... or we could just plonk them into group 3 (members) as Mikey did.

Any thoughts?
Group 3 is the default registered user group, if you plonk users with id's of '0' in there, it should be fine, HOWEVER, if the default 'member' usergroup is NOT 3, you run into more errors. A possible fix for that particular issue is to use the user group id for members that the administrator enters on the 'import usergroups' page.

Now, I dunno how feasible that would be for you as I haven't seen the code, though I know you write all the data to a table with the log of the import, I assume thats generated from an array of data, which you can probably pull from to grab the member_group_id the admin enters for members, THEN plonk members with member_group_id of 0 into there.
 

Kier

XenForo Developer
Staff member
#13
Yep, we can do that, I just needed feedback from IPB users as to whether member_group_id = 0 users should be considered regular members, or degenerate data. :)
 

Kier

XenForo Developer
Staff member
#14
The importer now detects degenerate member_group_id data and dumps those users in whatever group was specified as the registered members group.