1. 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.

Discussion in 'Resolved Bug Reports' started by Mikey, Apr 5, 2011.

  1. Mikey

    Mikey Well-Known Member

    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..
     
  2. Kier

    Kier XenForo Developer Staff Member

    Investigating.
     
    Mikey likes this.
  3. Mikey

    Mikey Well-Known Member

    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.
     
  4. Kier

    Kier XenForo Developer Staff Member

    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.
     
  5. Kier

    Kier XenForo Developer Staff Member

    FWIW it looks like you have a user with member_group_id = 0, which would be invalid.
     
    Mikey likes this.
  6. Mikey

    Mikey Well-Known Member

    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
     
  7. Kier

    Kier XenForo Developer Staff Member

    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?
     
  8. Mikey

    Mikey Well-Known Member

    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.
     
  9. Mikey

    Mikey Well-Known Member


    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 :)
     
    CurveGotti and Vincent like this.
  10. Kier

    Kier XenForo Developer Staff Member

    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 likes this.
  11. Brogan

    Brogan XenForo Moderator Staff Member

    Not everyone will know how to move them from group 0 to group 3, or even understand why it's failing in the first place, so I would go with your latter option.
     
    ArnyVee, Vincent and Darkimmortal like this.
  12. Mikey

    Mikey Well-Known Member

    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.
     
  13. Kier

    Kier XenForo Developer Staff Member

    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. :)
     
    Mikey likes this.
  14. Kier

    Kier XenForo Developer Staff Member

    The importer now detects degenerate member_group_id data and dumps those users in whatever group was specified as the registered members group.
     

Share This Page