XF 1.2 Forum Watch Error

DRE

Well-known member
I clicked on a subforum and got a forum watch error that would not let me view the subforum.

Disabled all listeners and I still get this same error.



Server Error

Mysqli prepare error: Unknown column 'forum_watch.node_id' in 'on 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 XenForo/Model/Forum.php at line 29
  6. XenForo_Model_Forum->getForumById() in XenForo/ControllerHelper/ForumThreadPost.php at line 177
  7. XenForo_ControllerHelper_ForumThreadPost->getForumOrError() in XenForo/ControllerHelper/ForumThreadPost.php at line 38
  8. XenForo_ControllerHelper_ForumThreadPost->assertForumValidAndViewable() in XenForo/ControllerPublic/Forum.php at line 88
  9. XenForo_ControllerPublic_Forum->actionForum() in XenForo/FrontController.php at line 335
  10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  11. XenForo_FrontController->run() in abadelabhaha/index.php at line 13
 
I need the full text from that to be sure, but ideally you'd need to contact the author of that add-on as it didn't clean up its tables/columns on uninstall to see what needs to be cleaned up.

In an ideal world, I'd say use your 1.1 backup, remove xf_forum_watch from it (and any forum watch remnants) and redo the upgrade.
 
xf_forum_watch CREATE TABLE `xf_forum_watch` (
`user_id` int(10) unsigned NOT NULL,
`forum_id` int(10) unsigned NOT NULL,
`reply_subscribe` tinyint(3) unsigned NOT NULL DEFAULT '0',
`notification_method` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`,`forum_id`),
KEY `forum_id_reply_subscribe` (`forum_id`,`reply_subscribe`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
 
*looks at BD Forum Watch Install.php file*

Code:
<?php
class ForumWatch_Installer {
   public static function install() {
     $db = XenForo_Application::get('db');
     
     $found = $db->fetchRow("SHOW TABLES LIKE 'xf_forum_watch'");
     if (empty($found)) {
       $db->query("
         CREATE TABLE `xf_forum_watch` (
           user_id INT UNSIGNED NOT NULL,
           forum_id INT UNSIGNED NOT NULL,
           reply_subscribe TINYINT UNSIGNED NOT NULL DEFAULT 0,
           PRIMARY KEY (user_id, forum_id),
           KEY forum_id_reply_subscribe (forum_id, reply_subscribe)
         ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
       ");
     }
     
     if ($db->fetchRow("SHOW COLUMNS FROM `xf_forum_watch` LIKE 'notification_method'")) {
       // look good
     } else {
       $db->query("ALTER TABLE `xf_forum_watch` ADD COLUMN notification_method TINYINT UNSIGNED NOT NULL DEFAULT 0");
     }
   }
   
   public static function uninstall() {
     // temporary leave our table alone...
     // TODO: drop it
   }
}
 
When you uninstalled the add-on, the table wasn't removed.

The table name is exactly the same as a new table in 1.2 for the same function.

Hence why your site is borked.
 
I need the full text from that to be sure, but ideally you'd need to contact the author of that add-on as it didn't clean up its tables/columns on uninstall to see what needs to be cleaned up.

In an ideal world, I'd say use your 1.1 backup, remove xf_forum_watch from it (and any forum watch remnants) and redo the upgrade.

So I remove uninstall xfrocks Forum watch addon, drop the table xf_forum_watch, then rebuild master data again.

It does not create that table for me when i rebuild master data. Do you have a sql query that I can run to manually recreate that table?
 
Code:
    CREATE TABLE xf_forum_watch (
        `user_id` int(10) unsigned NOT NULL,
        `node_id` int(10) unsigned NOT NULL,
        `notify_on` enum('','thread','message') NOT NULL,
        `send_alert` tinyint(3) unsigned NOT NULL,
        `send_email` tinyint(3) unsigned NOT NULL,
        PRIMARY KEY (`user_id`,`node_id`),
        KEY `node_id_notify_on` (`node_id`,`notify_on`)
    ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
 
Code:
    CREATE TABLE xf_forum_watch (
        `user_id` int(10) unsigned NOT NULL,
        `node_id` int(10) unsigned NOT NULL,
        `notify_on` enum('','thread','message') NOT NULL,
        `send_alert` tinyint(3) unsigned NOT NULL,
        `send_email` tinyint(3) unsigned NOT NULL,
        PRIMARY KEY (`user_id`,`node_id`),
        KEY `node_id_notify_on` (`node_id`,`notify_on`)
    ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci

You are the man. Thank you.
 
Code:
    CREATE TABLE xf_forum_watch (
        `user_id` int(10) unsigned NOT NULL,
        `node_id` int(10) unsigned NOT NULL,
        `notify_on` enum('','thread','message') NOT NULL,
        `send_alert` tinyint(3) unsigned NOT NULL,
        `send_email` tinyint(3) unsigned NOT NULL,
        PRIMARY KEY (`user_id`,`node_id`),
        KEY `node_id_notify_on` (`node_id`,`notify_on`)
    ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci

My site works now, thanks r.. man!
 
Top Bottom