• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • Duplicate entry '201-69-6' for key 'from_for'

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Duplicate entry '201-69-6' for key 'from_for'

    • Issue Tools
      • View Changes
    1. issueid=5122 June 22, 2017 8:18 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Duplicate entry '201-69-6' for key 'from_for'

      Code:
      An exception occurred: Mysqli statement execute error : Duplicate entry '201-69-6' for key 'from_for' in [path]/library/Zend/Db/Statement/Mysqli.php on line 214
      
          #0: Zend_Db_Statement_Mysqli->_execute() in [path]/library/Zend/Db/Statement.php at line 317
          #1: Zend_Db_Statement->execute() in [path]/library/Zend/Db/Adapter/Abstract.php at line 479
          #2: Zend_Db_Adapter_Abstract->query() in [path]/library/Zend/Db/Adapter/Abstract.php at line 574
          #3: Zend_Db_Adapter_Abstract->insert() in [path]/library/XenForo/DataWriter.php at line 1638
          #4: XenForo_DataWriter->_insert() in [path]/library/XenForo/DataWriter.php at line 1627
          #5: XenForo_DataWriter->_save() in [path]/library/vw/XenForo/DataWriter.php at line 356
          #6: vw_XenForo_DataWriter->_save() in [path]/library/XenForo/DataWriter.php at line 1419
          #7: XenForo_DataWriter->save() in [path]/vault/core/controller/dm/xf.php at line 415
          #8: vw_DM_Controller_XF->save() in [path]/vault/core/controller/import/handle/vw3/reputation/vw.php at line 229
          #9: vw_Import_Handle_VW3_Reputation_Controller->add_reputation() in [path]/vault/core/controller/import/handle/vw3/reputation/xf.php at line 21
          #10: vw_Import_Handle_VW3_Reputation_Controller_XF->add_reputation() in [path]/vault/core/controller/import/handle/vw3/reputation/vw.php at line 208
          #11: vw_Import_Handle_VW3_Reputation_Controller->do_reputation() in [path]/vault/core/controller/import/handle/vw3/reputation/vw.php at line 171
          #12: vw_Import_Handle_VW3_Reputation_Controller->do_reputations() in [path]/vault/core/controller/import/steps/vw3/vw.php at line 987
          #13: vw_Import_Steps_VW3_Controller->{closure}() in [path]/vault/core/controller/progress/steps/vw.php at line 83
          #14: vw_Progress_Steps_Controller->call() in [path]/vault/core/controller/progress/steps/vw.php at line 53
          #15: vw_Progress_Steps_Controller->execute() in [path]/vault/core/controller/progress/vw.php at line 92
          #16: vw_Progress_Controller->exec_script() in [path]/vault/core/controller/progress/vw.php at line 74
          #17: vw_Progress_Controller->execute() in [path]/vault/core/controller/cp/progress/vw.php at line 37
          #18: vw_CP_Progress_Controller->process() in [path]/vault/core/controller/cp/impex/vw.php at line 312
          #19: vw_CP_ImpEx_Controller->import() in [path]/vault/core/controller/cp/impex/vw.php at line 53
          #20: vw_CP_ImpEx_Controller->execute() in [path]/library/vw/XenForo/ControllerAdmin/Wiki.php at line 118
          #21: vw_XenForo_ControllerAdmin_Wiki->actionIndex() in [path]/library/XenForo/FrontController.php at line 351
          #22: XenForo_FrontController->dispatch() in [path]/library/XenForo/FrontController.php at line 134
          #23: XenForo_FrontController->run() in [path]/admin.php at line 13
    Issue Details
    Issue Number 5122
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Importing
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 4.0.18
    Fixed Version 4.0.19
    Milestone (none)
    Software DependencyXenForo 1.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. June 23, 2017 9:41 AM
      pegasus pegasus is offline
      VaultWiki Team
      This occurs when the source database allowed the same user to give reputation twice for the same content. The importer is not handling this situation gracefully. Please try the following edit to library/vw/XenForo/DataWriter.php. Find:
      Code:
      public function resetErrors()
      Before it, add:
      Code:
      	protected function _haveErrorsPreventSave()
      	{
      		if (!$this->_errors AND !$this->pre_save_retval)
      		{
      			// there was an error, but no error message
      			return true;
      		}
      
      		return parent::_haveErrorsPreventSave();
      	}
      On its own that should work, by preventing save when preSave sent a failed-status without specifying any error message. However, you can also fix the other part of the issue by adding an error message to vault/core/controller/dm/reputation/vw.php. Find:
      Code:
      $retval = false;
      After it, add:
      Code:
      $this->instance->error('vw_reputation_already');
      Reply Reply  
    2. June 23, 2017 11:06 AM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Why should the same content not get multiple ratings?
      Reply Reply  
    3. June 23, 2017 12:32 PM
      pegasus pegasus is offline
      VaultWiki Team
      Content should only get one rating from one user, but it may still receive additional ratings as long as they are from different users. If a user wants to change the rating they already submitted that is fine, but they should not rate it twice. That content can still get ratings from other people.

      While this issue is related to reputation, not ratings, the same rules apply. They are more important regarding reputation because even if the prior database allowed it, when imported into XenForo, there are only two states: Liked and Not Liked. If pegasus is able to like the same post 3 times, it will say "Liked by pegasus, pegasus, and 1 other person."
      Reply Reply  
    4. June 23, 2017 2:10 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      I missed that it concerned ratings by the same person.
      In vbulletin it was not possible to have multiple ratings from the same user for the same content.
      So I dont understand how it would be possible to get multiple ratings from the same user to the same content. Is there a bug there?
      Reply Reply  
    5. June 25, 2017 10:04 AM
      pegasus pegasus is offline
      VaultWiki Team
      While vBulletin's user interface performed tests to prevent a user from doing so, there were no such constraints within the database schema. Thus was possible for users to double submit reputation (such as double-clicking the submit button), creating a race condition to bypass the already-added-reputation check, and result in multiple reputation records for the same content; however, vBulletin's commands were staggered in such a way that it was unlikely for this situation to doubly increase the receiving user's reputation count/level, unless the admin decided to rebuild reputation.
      Reply Reply  
    6. June 25, 2017 12:07 PM
      pegasus pegasus is offline
      VaultWiki Team
      As a note, I believe it was also possible for this issue to occur if the import was already completed and you ran the same import again. The changes above should also be relevant in that case.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 4:51 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.