PDA

View Full Version : [IPB 2.1] Moving post in forum results in duplicate/empty post on site



lover
06-08-2006, 09:02 AM
Hey, I'm using IPB v2.1 with EP-Dev Forum News v2.20, and so far it's been the best thing that I've found to bring my forum's homepage to life.

Just a heads up, I found an error today, that causes a blank post when you manually move a post in IPB. After moving the post, the post featured on the website using EP-Dev Forum News then appears blank, in terms of post content. The topic title and author, etc, remain in-tact, it's just the post content that goes blank.

It only happens when you tick "Leave a link to the new topic in the source forum?" when moving the post. After I removed the dummy topic from the forum - which was a redirection to its new location - everything looked fine on the homepage again.

It's a bug, but it's managable!

Just wanted to give you guys a heads up if you didn't know about it already.

Thanks for the great script.

Patrick
06-10-2006, 02:49 PM
Thanks for letting me know... I will see if I can get it fixed in next version.

lover
09-06-2008, 02:53 AM
Haven't been on this forum in a while and realized I never posted the fix for this - sorry!
Although the script fully works with the latest IPB, this bug still exists, so here's the fix:

Open classes/sources/Forum/Invision_Power_Board_2.1.php

Find (around line 100):



// Prepare WHERE clause
$WHERE = "forum_id='" . implode("' or forum_id='", $ids_to_fetch) . "'";

// Pull from database
$this->DB->query("SELECT tid, title, posts, starter_id, start_date, starter_name, views, forum_id FROM " . $this->DB->prefix . "topics WHERE ". $WHERE ." ORDER BY tid DESC LIMIT " . $number_to_fetch);


Replace with:



// Prepare WHERE clause
$WHERE = "(forum_id='" . implode("' or forum_id='", $ids_to_fetch) . "') AND moved_to IS NULL";

// Pull from database
$this->DB->query("SELECT tid, title, posts, starter_id, start_date, starter_name, views, forum_id, moved_to FROM " . $this->DB->prefix . "topics WHERE ". $WHERE ." ORDER BY tid DESC LIMIT " . $number_to_fetch);