Download & Extend

SQL Error When Updating Chat Settings

Project:Chat Room
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Paul Kishimoto
Status:closed (fixed)

Issue Summary

I tried editing the settings for Update Frequency and Old Messages in Chat and received this error:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE nid = 35' at line 8 query: UPDATE chatroom SET poll_freq = 10000, idle_freq = 60000, old_msg_count = 10, kicked_out_message = '', banned_message = '', WHERE nid = 35 in /home3/sites/all/modules/chatroom/chatroom.module on line 157.

The settings I changed also did not take.

Comments

#1

if i understand it right, there are excessive commas in chatroom.module, function chatroom_update, at the end of lines 148 and 156.
when i removed them, the update in table chatroom succeeded.

(however, when re-entering the edit panel to check the freshly entered values, the kicked out message and banned message are not displayed. so my answer provokes another question ;-)

#2

i have the same error

#3

I do as well, running drupal 6.6 on php 5.2.

#4

Same here with Drupal 6.8. The error is actually just an extra comma on line 148 (before the "WHERE" on the next line). The comma on 157 is just a style thing (and I believe should be there, according to Drupal coding standards).

#5

Same problem here :O

#6

Confirm. #4 sorts out the problem.

#7

Assigned to:Anonymous» Paul Kishimoto
Status:active» reviewed & tested by the community

An actual patch! Originally posted to #335713: user warning on update...

AttachmentSize
328089.patch 379 bytes

#8

I confirm this patch is ok ( removing the last comma )

#9

Version:6.x-1.0-beta2» 6.x-2.x-dev
Status:reviewed & tested by the community» postponed (maintainer needs more info)

does this apply to the 6.x-2 branch?

#10

Status:postponed (maintainer needs more info)» closed (fixed)