Calendar BIGINT UNSIGNED value is out of range in '`xxx`.`xf_user`.`nf_calendar_event_count`

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : BIGINT UNSIGNED value is out of range in '`xxx`.`xf_user`.`nf_calendar_event_count` - 1' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: Alfa, A moment ago

Stack Trace
#0 /library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /library/NixFifty/Calendar/DataWriter/Event.php(1051): Zend_Db_Adapter_Abstract->query('\n\t\t\t\tUPDATE xf_...', Array)
#3 /library/NixFifty/Calendar/DataWriter/Event.php(946): NixFifty_Calendar_DataWriter_Event->_eventRemoved()
#4 /library/XenForo/DataWriter.php(1793): NixFifty_Calendar_DataWriter_Event->_postDelete()
#5 /library/NixFifty/Calendar/ControllerPublic/Event.php(683): XenForo_DataWriter->delete()
#6 /library/XenForo/FrontController.php(369): NixFifty_Calendar_ControllerPublic_Event->actionDelete()
#7 /library/XenForo/FrontController.php(152): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#8 /index.php(13): XenForo_FrontController->run()
#9 {main}
Request State
array(3) {
["url"] => string(79) "https://my-forum.com/events/tax-act-effective-oct-1-1937.11/delete"
["_GET"] => array(1) {
["/events/tax-act-effective-oct-1-1937_11/delete"] => string(0) ""
}
["_POST"] => array(3) {
["hard_delete"] => string(1) "1"
["_xfConfirm"] => string(1) "1"
["_xfToken"] => string(8) "********"
}
}
 
Could you send me the fix so I can proceed?
Pop open library/NixFifty/Calendar/DataWriter/Event, find this on or around line 1050:
Code:
SET nf_calendar_event_count = nf_calendar_event_count - 1

Replace it with:
Code:
SET nf_calendar_event_count = IF(nf_calendar_event_count > 0, nf_calendar_event_count - 1, 0)
This has no effect.
Not sure what you mean it has no effect? I just tried it and it works fine. When doing the import, the user counts aren't totaled. If you don't rebuild user event counts but try and delete an event, the current code will delete the event and try and minus 1 from 0 and then it breaks. Doing a user event count rebuild will ensure the user's total events aren't 0 and deleting won't throw an error. Regardless, the change above will harden it.
 
Back
Top