MyBB Community Forums

Full Version: Portal Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
If for instance you set the forum id for 10 and then move a topic into that forum, the topics content doesnt show up on the portal page, but when you post a new topic it does.
My news forum has id 4 and I've never had any problems with posts not showing on the portal page. I'm using a hidden forum to prepare these posts together with my admins and then move them into the news forum.
Maybe because 4 is just a one-digit number...Shy


Can
I've had this happen once to me before too, but I recently tryed to recreate the bug without any success Sad
The only thing I can advise at this point is that when it happens again, try to discover a pattern, as there is obviously a combination of events that is causing this.
http://rct3x.co.uk/myBB2/portal.php

The last and the first announcement in the portal does have a message, but it doesnt show up. I looked at the sql tables, and there doesnt seem to be any difference between the announcement with a missing message and the working announcements. I'll give you access to the sql, if you want.
Anyone able to recreate this?
I applied Peter's fix (through pm), it didnt fix it, but it doesnt seem to be happening again.
The thing I pm'ed was:

Try altering:
$query = $db->query("SELECT t.*, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid) WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%' ORDER BY t.lastpost DESC LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']);
to:
$query = $db->query("SELECT t.*, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid) WHERE 1=1 $unviewwhere AND t.visible='1' ORDER BY t.lastpost DESC LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']);
in portal.php. I'm not sure if this has any other implications, however.
right after WHERE there is 1=1; What that?
So if $unviewwhere is empty, there won't be a SQL error:

WHERE AND t.visible='1'
(error with WHERE AND together)

It would be

WHERE 1=1 AND t.visible='1'
(valid SQL)
Pages: 1 2