Defect #3356

Sometimes new posts don't show up in the topic list of a forum.

Added by Thomas P. over 8 years ago. Updated over 8 years ago.

Status:ClosedStart date:2009-05-13
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Forums
Target version:0.9.0
Resolution:Fixed Affected version:0.8.4

Description

Sometimes, when a user posts a new topic in the forum, it will not show up in the topic list of that forum.
However, the post is shown in the "last post" box on the forums overview.

I could not reproduce it because my (admin) posts show up. But I can see that various posts are not listed for whatever reason.

forumsbug1.tiff (23.4 KB) Thomas P., 2009-05-13 17:47

forumsbug2.tiff (33.4 KB) Thomas P., 2009-05-13 17:47

Associated revisions

Revision 2787
Added by Jean-Philippe Lang over 8 years ago

Fixed: editing a message may cause sticky attribute to be NULL (#3356).

History

#1 Updated by Jean-Philippe Lang over 8 years ago

Can you post the content of your database:
  • the row of the post that doesn't show up (select * from messages where id=[your message id])
  • the row of the board it belongs to (select * from boards where id=[your board id])

And please give your Redmine revision and database version.

#2 Updated by Thomas P. over 8 years ago

Redmine revision is 2737, database is mysql 5.0.51a-24 (Debian)

id   board_id  parent_id  subject  content author_id  replies_count  last_reply_id created_on           updated_on           locked  sticky
132  2         NULL       lig...   I...    1221       1              1326          2009-05-13 14:49:55  2009-05-13 19:18:48  NULL    NULL
id  project_id  name  description  position  topics_count  messages_count  last_message_id
2   1           Su..  if you n...  1         449           1083            1327

#3 Updated by Stefan B over 8 years ago

sticky NULL is the problem; it is at the end of the list (it should be 0).

#4 Updated by Jean-Philippe Lang over 8 years ago

This field should have a default value of 0 in your database:
source:/trunk/db/migrate/083_add_messages_sticky.rb

Can you check this?

#5 Updated by Stefan B over 8 years ago

Migration script is valid, db/schema.rb too, even checked mysql db:

mysql> describe messages;
+---------------+--------------+------+-----+---------+----------------+
| Field         | Type         | Null | Key | Default | Extra          |
+---------------+--------------+------+-----+---------+----------------+
[...]
| sticky        | int(11)      | YES  |     | 0       |                |
+---------------+--------------+------+-----+---------+----------------+

update messages set sticky=0 where sticky is null; fixed the issues temporarily yesterday, but there already new broken topics:

mysql> select id, board_id, parent_id, created_on, updated_on, sticky from messages where sticky is null;
+------+----------+-----------+---------------------+---------------------+--------+
| id   | board_id | parent_id | created_on          | updated_on          | sticky |
+------+----------+-----------+---------------------+---------------------+--------+
| 1340 |        2 |      1328 | 2009-05-14 08:06:48 | 2009-05-14 08:07:42 |   NULL |
| 1341 |        2 |      NULL | 2009-05-14 10:15:43 | 2009-05-14 10:36:46 |   NULL |
| 1345 |        2 |      NULL | 2009-05-14 14:18:48 | 2009-05-14 14:23:50 |   NULL |
+------+----------+-----------+---------------------+---------------------+--------+
3 rows in set (0.00 sec)

#6 Updated by Stefan B over 8 years ago

We hunted the bug...

Create a new topic, reply to it. Edit the reply. => sticky = NULL
Editing the first post works, only editing the reply is broken.

#7 Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from New to Closed
  • Target version set to 0.9.0
  • Affected version (unused) changed from devel to 0.8.4
  • Resolution set to Fixed
  • Affected version set to 0.8.4

Fixed in r2787. Thanks for pointing this out.

Also available in: Atom PDF