Seite 1 von 3
Fehler beim verschieben eines Beitrags
Verfasst: 14.12.2008 20:34
von larsu
Hi, wenn ich einen Beitrag verschieben will, erhalte ich folgende Fehlermeldung:
Code: Alles auswählen
Allgemeiner Fehler
SQL ERROR [ mysqli ]
[0]
SQL
No values specified for SQL IN comparison
BACKTRACE
FILE: includes/db/dbal.php
LINE: 379
CALL: dbal->sql_error()
FILE: includes/functions_admin.php
LINE: 454
CALL: dbal->sql_in_set()
FILE: includes/mcp/mcp_main.php
LINE: 637
CALL: move_topics()
FILE: includes/mcp/mcp_main.php
LINE: 93
CALL: mcp_move_topic()
FILE: includes/functions_module.php
LINE: 471
CALL: mcp_main->main()
FILE: includes/functions_module.php
LINE: 766
CALL: p_master->load_active()
FILE: mcp.php
LINE: 168
CALL: p_master->load()
Verfasst: 18.12.2008 14:29
von larsu
Könnte es auch an den mods liegen die ich eingebaut habe?
Ad management
ajax chat acp
announcement centre
arcade
bbcodebox3
html ranks
no avatar
last topic titles
partner mod
recent topics
shmk user feedback
simple acp pm read
user blog mod
user reputation points
Verfasst: 18.12.2008 18:36
von Miriam
Hast Du mal den Debug-Modus in der config.php eingeschaltet, indem Du für die letzten beiden Zeilen die Auskommentierung weggemacht hast?
Verfasst: 18.12.2008 18:46
von larsu
Dann kommt diese meldung
[phpBB Debug] PHP Notice: in file /includes/functions_admin.php on line 454: Undefined variable: post_ids
Verfasst: 18.12.2008 18:54
von Miriam
Ich denke mal, es sollte post_id heissen.. Also ohne S hintendran.
Schau mal in die angemeckerte Datei auf oder in der Nähe der Zeile, die genannt wurde.
Verfasst: 18.12.2008 20:24
von larsu
Dann kommt das:
[phpBB Debug] PHP Notice: in file /includes/functions_admin.php on line 454: Undefined variable: post_id
Aber ich habe herausgefunden aus welchem mod der fehler kommt, nämlich vom user reputation points mod.
Hier der teil aus der anleitung:
Open: includes/functions_admin.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
foreach ($table_ary as $table)
{
$sql = "DELETE FROM $table
WHERE " . $db->sql_in_set('post_id', $post_ids);
$db->sql_query($sql);
}
unset($table_ary);
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
// user reputation points
$sql = 'DELETE FROM ' . REPUTATIONS_TABLE . '
WHERE ' . $db->sql_in_set('rep_post_id', $post_ids);
$db->sql_query($sql);
// end
und hier die betreffende stelle aus meiner datei:
Code: Alles auswählen
while ($row = $db->sql_fetchrow($result))
{
$forum_ids[] = $row['forum_id'];
}
$db->sql_freeresult($result);
}
$table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
foreach ($table_ary as $table)
{
$sql = "UPDATE $table
SET forum_id = $forum_id
WHERE " . $db->sql_in_set('topic_id', $topic_ids);
$db->sql_query($sql);
}
unset($table_ary);
// user reputation points
$sql = 'DELETE FROM ' . REPUTATIONS_TABLE . '
WHERE ' . $db->sql_in_set('rep_post_id', $post_ids);
$db->sql_query($sql);
// end
if ($auto_sync)
{
sync('forum', 'forum_id', $forum_ids, true, true);
unset($forum_ids);
}
}
/**
* Move post(s)
*/
function move_posts($post_ids, $topic_id, $auto_sync = true)
{
global $db;
if (!is_array($post_ids))
{
$post_ids = array($post_ids);
}
$forum_ids = array();
$topic_ids = array($topic_id);
$sql = 'SELECT DISTINCT topic_id, forum_id
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('post_id', $post_ids);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$forum_ids[] = $row['forum_id'];
$topic_ids[] = $row['topic_id'];
}
$db->sql_freeresult($result);
$sql = 'SELECT forum_id
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $topic_id;
$result = $db->sql_query($sql);
$forum_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$forum_row)
{
trigger_error('NO_TOPIC');
}
$sql = 'UPDATE ' . POSTS_TABLE . '
SET forum_id = ' . $forum_row['forum_id'] . ", topic_id = $topic_id
WHERE " . $db->sql_in_set('post_id', $post_ids);
$db->sql_query($sql);
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . "
SET topic_id = $topic_id, in_message = 0
WHERE " . $db->sql_in_set('post_msg_id', $post_ids);
$db->sql_query($sql);
if ($auto_sync)
{
$forum_ids[] = $forum_row['forum_id'];
sync('topic_reported', 'topic_id', $topic_ids);
sync('topic_attachment', 'topic_id', $topic_ids);
sync('topic', 'topic_id', $topic_ids, true);
sync('forum', 'forum_id', $forum_ids, true, true);
Verfasst: 18.12.2008 21:29
von Miriam
Dann heisst es wohl doch post_ids.
Hast Du denn mal geprüft, ob diese Variable auch existiert? Also $post_ids.
Verfasst: 18.12.2008 22:46
von larsu
Dumme Frage, aber wie mache ich das denn?
Verfasst: 19.12.2008 14:38
von Miriam
Es könnte so klappen:
finde
Code: Alles auswählen
// user reputation points
$sql = 'DELETE FROM ' . REPUTATIONS_TABLE . '
WHERE ' . $db->sql_in_set('rep_post_id', $post_ids);
$db->sql_query($sql);
// end
davor setze ein:
Code: Alles auswählen
if (isset($post_ids)) var_dump($post_ids); else print("Keine Variable \$post_ids gesetzt.");
Verfasst: 19.12.2008 16:44
von larsu
Hat leider nicht geklappt, kommt immer noch der gleiche fehler...