• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Fixed Deleting item from category with 1 item

Status
Not open for further replies.

MagnusB

Member
Showcase
Not sure if this is a bug, or if something went wrong with my site. But I just installed, created a category and a test item, noticed I needed to redo the category a bit so I deleted the item. Then I got this error:
Code:
Server Error
 
Mysqli statement execute error : BIGINT UNSIGNED value is out of range in '(`DBNAME`.`xf_nflj_showcase_category`.`item_count` - 1)'
 
Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in NFLJ/Showcase/DataWriter/Item.php at line 315
NFLJ_Showcase_DataWriter_Item->_postDelete() in XenForo/DataWriter.php at line 1738
XenForo_DataWriter->delete() in NFLJ/Showcase/Model/Item.php at line 806
NFLJ_Showcase_Model_Item->deleteItem() in NFLJ/Showcase/ControllerPublic/Item.php at line 477
NFLJ_Showcase_ControllerPublic_Item->actionDelete() in XenForo/FrontController.php at line 310
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in ~/index.php at line 13
 
Its not you or your site, its a bug (an over site on my part in the post_delete method in the item datawriter). Its doing an action that should only be done with visible state items (which I over looked when I added in the "states" functionality for moderated and soft deleted).

I just fixed it. I'll be releasing RC 1 later today that will include the additional code in the datawriter that prevents this from happening.
 
Yeah, I just noticed that it was in moderation, I just took a quick allow all for admins and figured everything was OK.
 
  • Like
Reactions: Bob
I Normally don't oversee things like this lol Thanks for finding it :D
 
Completely by accident, I assure you :D

its a good thing ya caught it, or it might have not been caught for awhile lol RC1 is being released tomorrow. Im just finishing up the preliminary "featured" items functionality.
 
Don't mean to bump this up, but I got this on v 1.3.0 today when deleting an item. I had to delete it via phpmyadmin

Code:
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : BIGINT UNSIGNED value is out of range in '(`mycourtt_xenforo`.`xf_nflj_showcase_category`.`item_count` - 1)' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: oman, 5 minutes ago
Stack Trace
#0 /home/mycourtt/public_html/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/mycourtt/public_html/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/mycourtt/public_html/library/NFLJ/Showcase/Model/Category.php(823): Zend_Db_Adapter_Abstract->query('??            ?...', Array)
#3 /home/mycourtt/public_html/library/NFLJ/Showcase/DataWriter/Item.php(507): NFLJ_Showcase_Model_Category->updateItemCount(NULL, 3)
#4 /home/mycourtt/public_html/library/NFLJ/Showcase/DataWriter/Item.php(714): NFLJ_Showcase_DataWriter_Item->_updateRemoveCategoryItemsCount(3)
#5 /home/mycourtt/public_html/library/XenForo/DataWriter.php(1767): NFLJ_Showcase_DataWriter_Item->_postDelete()
#6 /home/mycourtt/public_html/library/NFLJ/Showcase/Model/Item.php(908): XenForo_DataWriter->delete()
#7 /home/mycourtt/public_html/library/NFLJ/Showcase/ControllerPublic/Index.php(1183): NFLJ_Showcase_Model_Item->deleteItem(Array, 'hard')
#8 /home/mycourtt/public_html/library/XenForo/FrontController.php(347): NFLJ_Showcase_ControllerPublic_Index->actionDelete()
#9 /home/mycourtt/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/mycourtt/public_html/index.php(13): XenForo_FrontController->run()
#11 {main}
Request State
array(3) {
  ["url"] => string(45) "http://mycourttalk.com/showcase/test.2/delete"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(3) {
    ["hard_delete"] => string(1) "1"
    ["_xfConfirm"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}

Mind you it may have been fixed in 1.3.1.
 
Dont mean to bump a old thread but also having similar error:

Mysqli statement execute error : BIGINT UNSIGNED value is out of range in '(`XXXXX`.`xf_user`.`showcase_count` - 1)'

  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 NFLJ/Showcase/DataWriter/Item.php at line 902
  4. NFLJ_Showcase_DataWriter_Item->_itemRemoved() in NFLJ/Showcase/DataWriter/Item.php at line 539
  5. NFLJ_Showcase_DataWriter_Item->_postSave() in Bookmarks/DataWriter/Showcase/Item.php at line 56
  6. Bookmarks_DataWriter_Showcase_Item->_postSave() in XenForo/DataWriter.php at line 1409
  7. XenForo_DataWriter->save() in NFLJ/Showcase/ControllerPublic/Showcase.php at line 1882
  8. NFLJ_Showcase_ControllerPublic_Showcase->actionDelete() in XenForo/FrontController.php at line 347
  9. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  10. XenForo_FrontController->run() in /home/medrookie/public_html/index.php at line 13
 
Did you rebuild all the counters? Part of the upgrade from the version that was happening in required rebuilding the counters. This was only possible on OLDER versions of showcase. Its not possible to do in new versions (unless you manually modify the count values in that field).
 
Did you rebuild all the counters? Part of the upgrade from the version that was happening in required rebuilding the counters. This was only possible on OLDER versions of showcase. Its not possible to do in new versions (unless you manually modify the count values in that field).
I just rebuilt all the counters with the same error.
 
Status
Not open for further replies.
Back
Top