Code: Select all
Clique aqui para voltar ao índice
Erro Geral
SQL ERROR [ mysqli ]
Not unique table/alias: 'p' [1066]
SQL
SELECT f.*, ft.mark_time, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, t.topic_id AS forum_last_post_topic_id, t.bestanswer_id, t.topic_id AS forum_last_post_topic_id FROM (phpbb_forums f) LEFT JOIN phpbb_forums_track ft ON (ft.user_id = 2 AND ft.forum_id = f.forum_id) LEFT JOIN phpbb_users u ON (u.user_id = f.forum_last_poster_id AND forum_type != 0) LEFT JOIN phpbb_posts p ON (f.forum_last_post_id = p.post_id) LEFT JOIN phpbb_topics t ON (t.topic_id = p.topic_id) LEFT JOIN phpbb_posts p ON (f.forum_last_post_id = p.post_id) LEFT JOIN phpbb_topics t ON (t.topic_id = p.topic_id) ORDER BY f.left_id
BACKTRACE
FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()
FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 855
CALL: trigger_error()
FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 193
CALL: phpbb\db\driver\driver->sql_error()
FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 329
CALL: phpbb\db\driver\mysqli->sql_query()
FILE: [ROOT]/includes/functions_display.php
LINE: 151
CALL: phpbb\db\driver\factory->sql_query()
FILE: [ROOT]/index.php
LINE: 75
CALL: display_forums()
Por favor, contate o administrador ou webmaster deste fórum: lucas_vinicius98@live.com
Powered by phpBB® Forum Software © phpBB Limited
Code: Select all
[removed]
Code: Select all
[removed]
$sql_ary['LEFT_JOIN'][] .= array(...);
won't work as .=
is only applicable to strings.Code: Select all
$sql_ary['FROM'][] = array(
POSTS_TABLE => 'p',
TOPICS_TABLE => 't',
);
Code: Select all
array(
FORUMS_TABLE => 'f',
array(
POSTS_TABLE => 'p',
TOPICS_TABLE => 't',
)
);
Code: Select all
$sql_ary['FROM'] = array_merge($sql_ary['FROM'], array(
POSTS_TABLE => 'p',
TOPICS_TABLE => 't',
));
display_forums()
function nor in this extension, so it's likely that there's a conflict with another extension that adds the duplicate left joins on the phpbb_posts and phpbb_topics table.Ah, you're right. I had a brain fart there.kasimi wrote:
$sql_ary['LEFT_JOIN'][] .= array(...);
won't work as.=
is only applicable to strings.
I missed this. Thanks for pointing it out. I'll leave the code the way it is.kasimi wrote:the SQL error there's a left join on the phpbb_users table which neither happens in phpBB'sdisplay_forums()
function nor in this extension, so it's likely that there's a conflict with another extension
Try to disable those that deal with avatars.SalazarAG wrote:But they are many, it is difficult to find.
I disabled "Last post avatar" and the erros appears changedkasimi wrote:Try to disable those that deal with avatars.SalazarAG wrote:But they are many, it is difficult to find.
Code: Select all
Erro Geral
SQL ERROR [ mysqli ]
Not unique table/alias: 'p' [1066]
SQL
SELECT f.*, ft.mark_time, t.topic_id AS forum_last_post_topic_id, t.bestanswer_id, t.topic_id AS forum_last_post_topic_id FROM (phpbb_forums f) LEFT JOIN phpbb_forums_track ft ON (ft.user_id = 2 AND ft.forum_id = f.forum_id) LEFT JOIN phpbb_posts p ON (f.forum_last_post_id = p.post_id) LEFT JOIN phpbb_topics t ON (t.topic_id = p.topic_id) LEFT JOIN phpbb_posts p ON (f.forum_last_post_id = p.post_id) LEFT JOIN phpbb_topics t ON (t.topic_id = p.topic_id) ORDER BY f.left_id
BACKTRACE
FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()
FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 855
CALL: trigger_error()
FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 193
CALL: phpbb\db\driver\driver->sql_error()
FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 329
CALL: phpbb\db\driver\mysqli->sql_query()
FILE: [ROOT]/includes/functions_display.php
LINE: 151
CALL: phpbb\db\driver\factory->sql_query()
FILE: [ROOT]/index.php
LINE: 75
CALL: display_forums()
t.topic_id AS forum_last_post_topic_id
as well as those two duplicate left joins. Try to disable any extension that works with data from a forum's last post.You could try to only add the left joins if they aren't already present. I'm not sure if that's the most reliable way though.kinerity wrote:I'll leave the code the way it is.
Code: Select all
if (!$this->has_left_join($sql_ary['LEFT_JOIN'], POSTS_TABLE))
{
$sql_ary['LEFT_JOIN'][] = array(
'FROM' => array(POSTS_TABLE => 'p'),
'ON' => 'f.forum_last_post_id = p.post_id',
);
}
TOPICS_TABLE
. Here's the has_left_join()
function:Code: Select all
private function has_left_join($haystack, $needle)
{
foreach ($haystack as $left_join)
{
if (isset($left_join['FROM'][$needle]))
{
return true;
}
}
return false;
}
That line is probably going to change. I don't think it's needed, but I need to test it out. As a matter of fact, that whole function will probably change.kasimi wrote:Looks like there's another extension that addst.topic_id AS forum_last_post_topic_id