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

Fixed Error while deleting messages

Discussion in 'Resolved Bug Reports' started by Pepelac, Mar 2, 2011.

  1. Pepelac

    Pepelac Well-Known Member

    This happens when someone tries to delete message permanently.

    Server Error

    Mysqli statement execute error : Out of range value adjusted for column 'position' at row 1

    1. Zend_Db_Statement_Mysqli->_execute()inZend/Db/Statement.phpat line297
    2. Zend_Db_Statement->execute()inZend/Db/Adapter/Abstract.phpat line479
    3. Zend_Db_Adapter_Abstract->query()inXenForo/DataWriter/DiscussionMessage.phpat line948
    4. XenForo_DataWriter_DiscussionMessage->_adjustPositionListForRemoval()inXenForo/DataWriter/DiscussionMessage.phpat line712
    5. XenForo_DataWriter_DiscussionMessage->_postDelete()inXenForo/DataWriter.phpat line1645
    6. XenForo_DataWriter->delete()inXenForo/Model/InlineMod/Post.phpat line118
    7. XenForo_Model_InlineMod_Post->deletePosts()inXenForo/ControllerPublic/InlineMod/Abstract.phpat line125
    8. XenForo_ControllerPublic_InlineMod_Abstract->executeInlineModAction()inXenForo/ControllerPublic/InlineMod/Post.phpat line40
    9. XenForo_ControllerPublic_InlineMod_Post->actionDelete()inXenForo/FrontController.phpat line310
    10. XenForo_FrontController->dispatch()inXenForo/FrontController.phpat line132
    11. XenForo_FrontController->run()in/path/to/docroot/index.phpat line17

    I've made a quick fix for RC3, maybe it'll help someone:
    in the file library/XenForo/DataWriter/DiscussionMessage.php replace line 944 SET position = position - 1 with this - SET position = IF (position=0, 0, position - 1)
     
    Pavel Safonov likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    Does it happen anywhere you try to do a deletion? Can you include the exact steps that you used (including the number of which posts you chose to delete and if any of them weren't "visible")?

    The error indicates that the values were wrong before. Really, I'd need to see the xf_post.position values for the thread in question. However, the key isn't that they're wrong - it's figuring out why they're wrong.
     
  3. Pepelac

    Pepelac Well-Known Member

    I see. I'll try to collect some info and later will post here.
     
  4. Pepelac

    Pepelac Well-Known Member

    So here is brief info (that isn't my forum, so that wasn't me, who got that error).

    He was trying to delete 33 messages from one thread. As usual, he selected posts and deleted them via inline mod tool. He tried both "safe" deletion (hide messages) and permanent deletion. As the result - that error.

    I'm waiting now for access to the DB and for the dump of the posts table from yesterday. As I'll get it - I'll post some more info.
     
  5. Pepelac

    Pepelac Well-Known Member

    So... I've got some info, but not as much, as I expected.
    I have a xf_post table dump, but it is a bit old, so there weren't some posts...
    And currently, admin of that web has deleted / moved some posts from that list (IDs I've got form the ACP server error list, text of the error is in the attachment), so it's not possible to find out what was wrong with deleted posts...

    So, attached you will find error text and csv files with selection from the dumped table (from backup) and from the current table.

    Csv files were made with the next query
    Code:
    SELECT post_id, post_date, message_state, position FROM xf_post WHERE post_id IN (
    21678, 21698, 21702, 21705, 21711, 21754, 21774, 21872, 21908, 22005, 22007, 22010, 22038, 22147, 22162, 22187, 22192, 22458, 26123, 26274, 26746, 26786, 26787, 26795, 26797, 26800, 26801, 26807, 26808, 26813, 26816, 26822, 26825
    )
     

    Attached Files:

  6. Pepelac

    Pepelac Well-Known Member

    Get one more forum with this error.
    Now user tried to delete permanently 316 posts.
    See error attached
     

    Attached Files:

  7. Pepelac

    Pepelac Well-Known Member

    And here is csv dump for those posts...
     

    Attached Files:

  8. Pepelac

    Pepelac Well-Known Member

    So, any news? Will this be fixed? Or I must use quick fix from the first post?
     
    Vincent and Pavel Safonov like this.
  9. Pavel Safonov

    Pavel Safonov Member

  10. Mike

    Mike XenForo Developer Staff Member

    I suspect that at least for now, we'll have to use the workaround.
     
  11. Pepelac

    Pepelac Well-Known Member

    Thank you for reply. Workaround from the first post?
     
  12. Mike

    Mike XenForo Developer Staff Member

    Yeah, I believe so.
     

Share This Page