Calendar v1.0.0 B7 Unknown column 'last_update' in 'order clause' causing entire site error

Server Error
Mysqli prepare error: Unknown column 'last_update' in 'order clause'

  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 753
  5. Zend_Db_Adapter_Abstract->fetchRow() in NixFifty/Calendar/DataWriter/Calendar.php at line 252
  6. NixFifty_Calendar_DataWriter_Calendar->updateLastUpdate() in NixFifty/Calendar/DataWriter/Calendar.php at line 286
  7. NixFifty_Calendar_DataWriter_Calendar->rebuildCounters() in NixFifty/Calendar/Deferred/Calendar.php at line 21
  8. NixFifty_Calendar_Deferred_Calendar->execute() in XenForo/Model/Deferred.php at line 295
  9. XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 429
  10. XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 374
  11. XenForo_Model_Deferred->run() in XenForo/ControllerAdmin/Tools.php at line 159
  12. XenForo_ControllerAdmin_Tools->actionRunDeferred() in XenForo/FrontController.php at line 369
  13. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 152
  14. XenForo_FrontController->run() in /admin.php at line 13
 
Last edited:
@NixFifty Unable to use the entire XF site because of this error appearing on every page, site home page etc.

Server Error
Mysqli prepare error: Unknown column 'event.last_update' in 'where clause'

  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 791
  5. Zend_Db_Adapter_Abstract->fetchCol() in NixFifty/Calendar/Model/Event.php at line 1670
  6. NixFifty_Calendar_Model_Event->getUnreadEventIds() in NixFifty/Calendar/Listen.php at line 42
  7. NixFifty_Calendar_Listen::controllerPreDispatch() in XenForo/CodeEvent.php at line 58
  8. XenForo_CodeEvent::fire() in XenForo/Controller.php at line 313
  9. XenForo_Controller->preDispatch() in XenForo/FrontController.php at line 368
  10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 152
  11. XenForo_FrontController->run() in index.php at line 13

Code:
mysql> describe xf_nf_calendar_event;
+-------------------+------------------------------------------+------+-----+---------------+----------------+
| Field             | Type                                     | Null | Key | Default       | Extra          |
+-------------------+------------------------------------------+------+-----+---------------+----------------+
| event_id          | int(11) unsigned                         | NO   | PRI | NULL          | auto_increment |
| event_title       | varchar(255)                             | NO   |     | NULL          |                |
| user_id           | int(11)                                  | NO   |     | NULL          |                |
| username          | varchar(50)                              | NO   |     | NULL          |                |
| calendar_id       | int(10) unsigned                         | NO   |     | 0             |                |
| created_date      | int(11)                                  | NO   |     | NULL          |                |
| description       | mediumtext                               | NO   |     | NULL          |                |
| event_state       | enum('visible','moderated','deleted','') | NO   |     | visible       |                |
| start_date        | int(11)                                  | NO   |     | NULL          |                |
| end_date          | int(11)                                  | NO   |     | NULL          |                |
| all_day           | int(1)                                   | NO   |     | 0             |                |
| timezone          | varchar(255)                             | NO   |     | Europe/London |                |
| location          | varchar(255)                             | NO   |     |               |                |
| ip_id             | int(10) unsigned                         | NO   |     | 0             |                |
| likes             | int(10) unsigned                         | NO   |     | 0             |                |
| like_users        | blob                                     | NO   |     | NULL          |                |
| featured          | tinyint(3) unsigned                      | NO   |     | 0             |                |
| thread_id         | int(10) unsigned                         | NO   |     | 0             |                |
| edit_date         | int(10) unsigned                         | NO   |     | 0             |                |
| last_edit_date    | int(10) unsigned                         | NO   |     | 0             |                |
| last_edit_user_id | int(10) unsigned                         | NO   |     | 0             |                |
| edit_count        | int(10) unsigned                         | NO   |     | 0             |                |
| request_rsvp      | tinyint(3) unsigned                      | NO   |     | 0             |                |
+-------------------+------------------------------------------+------+-----+---------------+----------------+
23 rows in set (0.00 sec)

Fixed with ...

Code:
mysql> alter table xf_nf_calendar_event add column last_update INT(10) UNSIGNED NOT NULL DEFAULT 0;
Query OK, 0 rows affected (0.12 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> create index calendar_last_update on xf_nf_calendar_event (`calendar_id`, `last_update`);
Query OK, 0 rows affected (0.05 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> create index user_id_last_update on xf_nf_calendar_event (`user_id`, `last_update`);
Query OK, 0 rows affected (0.05 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
Last edited:
Back
Top