News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Error with all unread topics

Started by Katsumoto, January 05, 2015, 05:46:02 PM

Previous topic - Next topic

Katsumoto

After upgrading I get the following error when I click on the "all unread topics" option.

Unknown column 'lt.unwatched' in 'where clause'
File: /Sources/Recent.php
Line: 828


Unknown column 'lt.unwatched' in 'where clause'

SELECT COUNT(*), MIN(t.id_last_msg)
FROM smf_topics AS t
LEFT JOIN smf_log_topics_unread AS lt ON (lt.id_topic = t.id_topic)
LEFT JOIN smf_log_mark_read AS lmr ON (lmr.id_board = t.id_board AND lmr.id_member = 1)
WHERE t.id_board IN (3, 4, 5, 6, 8, 10, 15, 16, 17, 18, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 32, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 52, 53, 54, 55, 57, 59, 60, 61, 62, 63, 65, 70, 71, 72, 73, 74, 75, 78, 87, 88, 89, 90, 91, 93, 180, 190, 192, 193, 194, 195, 196, 198, 200, 201, 203, 204, 205, 206, 207, 208, 209, 210, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 227, 229, 230, 233, 234, 236, 237, 239, 240, 243, 244, 245, 246, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 370, 372, 373, 376, 377, 378, 379, 380, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454)
AND t.id_last_msg > 214157
AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < t.id_last_msg AND lt.unwatched != 1


Please help. Thanks. :)

Kindred

Did you run the full upgrade.php and did it complete?  Because the error would suggest that you did not do so.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Actually it wouldn't because log_topics_unread is a temporary table that doesn't define an unwatched column. I would assume this is actually supposed to be joining on log_topics instead. Filed on Github as bug.

Katsumoto

Is there any solution how to solve this problem? :)

Illori

it will be resolved when the devs fix it.

margarett

Out of curiosity, how many posts do you have?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Arantor

Enough to fall into the side branch where the temporary table is created ;)

It probably just needs replacing log_topics_unread with log_topics around line 819... ;)

Oldiesmann

The query to create the temporary table already has "lt.unwatched != 1" in the WHERE clause, so it's not needed for the query to pull things from the temporary table. A fix will be committed to GitHub shortly (so it'll be fixed in the next beta). If you want to fix it yourself now...

Line 820 of Recent.php

Find
AND t.approved = {int:is_approved}' : '') . ' AND lt.unwatched != 1',

Replace
AND t.approved = {int:is_approved}' : ''),
Michael Eshom
Christian Metal Fans

Katsumoto

Thank you. I replaced this line of code, but it still does not work. :/

EDIT:
I replaced this line of code at the four places in Recent.php. Everything is OK now. Thank you very much.

Advertisement: