FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » error when deleting orphaned forum
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
error when deleting orphaned forum [message #21937] Tue, 04 January 2005 19:02 Go to next message
mikelcu is currently offline  mikelcu   United States
Messages: 7
Registered: January 2005
Location: Portland, OR
Karma: 0
Junior Member
I am getting a PgSQL error when deleting orphaned forums. It seems that the forum id is referenced incorrectly in forum_adm.inc. This is the result, notice the forum ID is missing from the table name in the DROP TABLE statement:

Warning: pg_query(): Query failed: ERROR: table "fud26_fl_" does not exist in /FUDforum/include/theme/default/db.inc on line 147
(/FUDforum/include/theme/default/db.inc:147
/FUDforum/include/forum_adm.inc:170
/www/adm/admdelfrm.php:48
) : ERROR: table "fud26_fl_" does not exist
Query: DROP TABLE fud26_fl_
_POST: S=4d8f363743f766b9023ffac4664035d4&SQ=96369f2b638fde9fd56d9c09eb9ef6cd&del=2&conf=Yes&
Server Version: 
[Referring Page] http://forums.aoforge.net/adm/admdelfrm.php?del=2&rid=2&S=4d8f363743f766b9023ffac4664035d4&SQ=96369f2b638fde9fd56d9c09eb9ef6cd



I located what appears to be the error in forum_adm.inc, $id was referenced via an object instead of a local variable. Here is a patch that fixes this:

--- forum_adm.inc       2005-01-04 18:49:31.190025648 +0000
+++ forum_adm.inc.new   2005-01-04 18:48:14.683656384 +0000
@@ -167,7 +167,7 @@
        q('DELETE FROM '.$tbl.'mlist WHERE forum_id='.$id);
        q('DELETE FROM '.$tbl.'nntp WHERE forum_id='.$id);
        $gid = q_singleval('SELECT id FROM '.$tbl.'groups WHERE forum_id='.$id);
-       q("DROP TABLE ".$tbl."fl_".$this->id);
+       q("DROP TABLE ".$tbl."fl_".$id);
        q('DELETE FROM '.$tbl.'forum WHERE id='.$id);

        db_unlock();



Feel free to let me know if this is wrong/stupid (but hey it works) Smile
Re: error when deleting orphaned forum [message #21940 is a reply to message #21937] Tue, 04 January 2005 19:48 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
This was already fixed in CVS a few weeks ago, but thanks for taking the time to analyze the problem and present a possible fix.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: FUD and Firefox - wrong wiev
Next Topic: Unable to delete forum: Unknown table
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 19:12:27 GMT 2024

Total time taken to generate the page: 0.02475 seconds