Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forum/newforumposts_menu.php - SQL error #3757

Closed
Jimmi08 opened this issue Mar 24, 2019 · 5 comments
Closed

forum/newforumposts_menu.php - SQL error #3757

Jimmi08 opened this issue Mar 24, 2019 · 5 comments
Labels
plugin: forum type: bug A problem that should not be happening

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Mar 24, 2019

adding new newforumposts_menu.php to bootstrap3, I got SQL error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ORDER BY p.post_datestamp DESC LIMIT 0, 10' at line 12

Array
(
    [0] => Array
        (
            [file] => G:\php72\htdocs\e107-whisper\e107_handlers\mysql_class.php
            [line] => 551
            [function] => query
            [class] => PDO
            [type] => ->
            [args] => Array
                (
                    [0] => 
					SELECT
					p.post_user, p.post_id, p.post_datestamp, p.post_user_anon, p.post_entry,
					t.*,
					u.user_id, u.user_name, u.user_image, u.user_currentvisit,
					lu.user_name as thread_lastuser_username, 
					f.forum_name, f.forum_sef
					FROM e107_forum_post as p
					LEFT JOIN e107_forum_thread AS t ON t.thread_id = p.post_thread
					LEFT JOIN e107_forum as f ON f.forum_id = t.thread_forum_id
					LEFT JOIN e107_user AS u ON u.user_id = p.post_user
					LEFT JOIN e107_user AS lu ON t.thread_lastuser = lu.user_id
					WHERE  p.post_forum IN ()
					ORDER BY p.post_datestamp DESC LIMIT 0, 10 
                )

        )


There are no posts yet, so maybe this is the reason?

@Moc
Copy link
Member

Moc commented Mar 26, 2019

Cannot reproduce so far, it shows the "No posts yet" message for me.

image

PHP 7 and MySQL with PDO?

@Moc Moc added the status: testing required Someone needs to confirm this issue's existence and write a test to prevent the fix from regressing. label Mar 26, 2019
@Moc
Copy link
Member

Moc commented Mar 26, 2019

This is the issue for you

WHERE p.post_forum IN ()

for me it says:

WHERE p.post_forum IN (1,2,3,4,5)

1-5 are forum categories.

You are sure you are using the right forum menu? The one in the forum plugin folder, not the one in the newforumposts_main folder right?

@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Mar 26, 2019

@Moc I found it when used the empty forum, so no forum categories. Just installed forum plugin. There is no test if any forum exists. I double checked that it's that new menu, but I will do it again.

@Moc
Copy link
Member

Moc commented Mar 26, 2019

Whoops, that makes sense.... sorry, should have thought of that. Reproduced it now.
So we need to add a check if there's categories added indeed.

@Moc Moc added type: bug A problem that should not be happening plugin: forum and removed status: testing required Someone needs to confirm this issue's existence and write a test to prevent the fix from regressing. labels Mar 26, 2019
@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Mar 26, 2019

@Moc no problem, it's just happened... it's not common to have this menu before any forum records. I just wanted to report it :)

@Moc Moc closed this as completed in 67129d7 Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: forum type: bug A problem that should not be happening
Projects
None yet
Development

No branches or pull requests

2 participants