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

Fixed XF to XF "Import Profile Posts"

Discussion in 'Resolved Bug Reports' started by DRE, Aug 3, 2013.

  1. DRE

    DRE Well-Known Member

    Got this error when importing Profile Posts

    Mysqli statement execute error : Column 'user_id' cannot be null

    1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
    2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
    3. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
    4. Zend_Db_Adapter_Abstract->insert() in XenForo/Model/Ip.php at line 62
    5. XenForo_Model_Ip->logIp() in XenForo/Model/Import.php at line 1698
    6. XenForo_Model_Import->importIp() in XenForo/Model/Import.php at line 1209
    7. XenForo_Model_Import->importProfilePost() in XenForo/Importer/XenForo.php at line 1117
    8. XenForo_Importer_XenForo->stepProfilePosts() in XenForo/Importer/Abstract.php at line 77
    9. XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 180
    10. XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 132
    11. XenForo_ControllerAdmin_Import->actionImport() in XenForo/FrontController.php at line 337
    12. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    13. XenForo_FrontController->run() in /home/me/public_html/test/admin.php at line 13
     
  2. DRE

    DRE Well-Known Member

    Oh I figured out the problem. Members who got deleted in the past, their profile posts have remained and so have their person conversations. Apparently the importer won't import Personal Conversations and Profile Posts if that conversation or profile post was made by a guest.
     
  3. DRE

    DRE Well-Known Member

    There was a spammer named brindabenson and she has a soft-deleted profile post on alot of people's profiles (thank you for hiding the members list in Xenforo 1.2) so now I'm just manually deleting her profile posts. Pretty annoying since I have around 500 profiles to go through.
     
  4. DRE

    DRE Well-Known Member

  5. Chris D

    Chris D XenForo Developer Staff Member

    Would be even quicker just doing a DB query surely.
     
  6. DRE

    DRE Well-Known Member

    What's a database query for deleting profile posts by brendabenson?
     
  7. Chris D

    Chris D XenForo Developer Staff Member

    I think it's just:

    Code:
    DELETE FROM xf_profile_post WHERE user_id = ?
    Or, as long as you're certain the username is correct:

    Code:
    DELETE FROM xf_profile_post WHERE username = 'brendabenson'
     
  8. DRE

    DRE Well-Known Member

    How would I delete posts this way?
    and conversation messages?
     
  9. DRE

    DRE Well-Known Member

    Nevermind this problem is worse than I thought. I saw more deleted accounts (deleted spammers) on both profile posts and threads. I don't know all their usernames. I will have to wait for the next version of this importer and cross my fingers that it ignores guests during the import.
     
  10. Kier

    Kier XenForo Developer Staff Member

    Reading back through my code, I can see that Profile Posts will error when encountering a guest (or deleted user) profile post - and I've now resolved that, but the Threads and Posts import should work fine with guest posts.
     
    DRE likes this.
  11. Kier

    Kier XenForo Developer Staff Member

    If you want to try applying my fix to profile posts, you need to add a default 0 to the map look-ups for user_id in profile posts and profile post comments as you can see with this diff.

    Screen Shot 2013-08-05 at 12.02.11.png
     
    DRE likes this.
  12. DRE

    DRE Well-Known Member

    Thanks. This fixed the profile posts issue. :D They now import fine.
     

Share This Page