• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Forum Watch Error

DRE

Well-known member
#1
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
 

Mike

XenForo developer
Staff member
#5
Did you ever have one installed?

Can you run this query?
Code:
SHOW CREATE TABLE xf_forum_watch;
 

Mike

XenForo developer
Staff member
#7
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.
 

DRE

Well-known member
#8
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
 

DRE

Well-known member
#10
*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
   }
}
 

Brogan

XenForo moderator
Staff member
#13
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.
 

Andy.N

Well-known member
#15
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?
 

xf_phantom

Well-known member
#16
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
 

Andy.N

Well-known member
#17
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.
 

DRE

Well-known member
#18
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!