SQl Error when posting a topic

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
khans16
Registered User
Posts: 7
Joined: Mon Dec 23, 2013 8:35 pm

SQl Error when posting a topic

Post by khans16 »

Support Request Template
What version of phpBB are you using? phpBB 3.0.12
What is your board's URL? http://n/a
Who do you host your board with? Company Internal Datacenter
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Update from a previous version of phpBB3
Is registration required to reproduce this issue? Yes
Do you have any MODs installed? Yes
What version of phpBB3 did you update from? phpBB 3.0.11
What MODs do you have installed? BoardWatch
What styles do you currently have installed? prosilver * , subsilver2
What language(s) is your board currently using? No answer given
Which database type/version are you using? I Don't Know
What is your level of experience? Please select your answer
What username can be used to view this issue? British English
What password can be used to view this issue? No answer given
When did your problem begin? A few months back. No specific install or change caused the issue. I upgraded to latest version today but problem persists
Please describe your problem. Whenever users submits a post they get the SQL error below. The post is successful though and can be viewed when one goes back to board index. Email is also successfully sent to subscribers. This message is only displayed when submit is clicked. When a post is edited this message is not displayed.


SQL Error:

General Error
SQL ERROR [ mysqli ]

[0]

SQL

No values specified for SQL IN comparison

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/db/dbal.php
LINE: 757
CALL: trigger_error()

FILE: [ROOT]/includes/db/dbal.php
LINE: 432
CALL: dbal->sql_error()

FILE: [ROOT]/includes/functions_posting.php
LINE: 1411
CALL: dbal->sql_in_set()

FILE: [ROOT]/includes/functions_posting.php
LINE: 2654
CALL: user_notification()

FILE: [ROOT]/posting.php
LINE: 1141
CALL: submit_post()

=====================

Line 1141 from posting.php

// The last parameter tells submit_post if search indexer has to be run
$redirect_url = submit_post($mode, $post_data['post_subject'], $post_author_name, $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
Generated by SRT Generator
Last edited by khans16 on Mon Dec 23, 2013 9:14 pm, edited 2 times in total.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52106
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQl Error when posting a topic

Post by Brf »

The error is occurring in user_notification, which would have been modified by Board Watch, so you need to seek support in the support area for that mod.
khans16
Registered User
Posts: 7
Joined: Mon Dec 23, 2013 8:35 pm

Re: SQl Error when posting a topic

Post by khans16 »

I should have clarified earlier but the error was there even before I installed boardwatch. The post does get submitted even though the error is displayed and email notification is also successfully delivered.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52106
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQl Error when posting a topic

Post by Brf »

In the unmodified routine, the SQL IN is not executed unless there is something in there.
Here is one example:

Code: Select all

if (!empty($update_notification['topic']))
	{
		$sql = 'UPDATE ' . TOPICS_WATCH_TABLE . '
			SET notify_status = ' . NOTIFY_NO . "
			WHERE topic_id = $topic_id
				AND " . $db->sql_in_set('user_id', $update_notification['topic']);
		$db->sql_query($sql);
	}
You see it does not execute the block if the array is empty.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: SQl Error when posting a topic

Post by asinshesq »

khans16 wrote:I should have clarified earlier but the error was there even before I installed boardwatch. The post does get submitted even though the error is displayed and email notification is also successfully delivered.
Khans16 says the error was there before boardwatch and if that's true his problem can't be caused by boardwatch. Khans16, I suggest you zip up your includes/functions_posting.php file and upload it here (or give us a link for it) and we can take a look and see what's wrong. And while you're at it, might as well include posting.php as well.
khans16
Registered User
Posts: 7
Joined: Mon Dec 23, 2013 8:35 pm

Re: SQl Error when posting a topic

Post by khans16 »

I was mistaken about that. I went back and checked the email thread and the problem was after the boardwatch install. The issue has been there for many months but since the post does go through I thought I would address it later. It is more of an annoyance than anything else but would like to know what may be causing this.

I have uploaded zip file of includes/functions_posting.php here as well as to boardwatch support forum which may be useful in debugging the issue.
Attachments
functions_posting.php.gz
Zip of includes/functions_posting.php
(19.92 KiB) Downloaded 18 times
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: SQl Error when posting a topic

Post by asinshesq »

Ok, you made a mistake in installing the mod. Solution here: https://www.phpbb.com/customise/db/mod/ ... 76#p331876
khans16
Registered User
Posts: 7
Joined: Mon Dec 23, 2013 8:35 pm

Re: SQl Error when posting a topic

Post by khans16 »

The suggested code change by Alan fixed the problem. Will remember to use automod in future to avoid this kind of situation.
Locked

Return to “[3.0.x] Support Forum”