As follow up to #271582: Allow anonymous users to flag content, regarding Comment #20, I had the same error with the current dev.

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 '' at line 1 query: SELECT * FROM flag_content WHERE content_type = 'node' AND content_id = 2 AND (uid = 0 OR uid = 0) AND sid =

This error is simply resolved by replacing the last two %s placeholders with the %d (as it is done in the rest of the module). Patch for this will be attached in first comment.

CommentFileSizeAuthor
#1 flag_sql_error_sid-1293448-1.patch1.71 KBderhasi

Comments

derhasi’s picture

StatusFileSize
new1.71 KB

And here comes the patch.

derhasi’s picture

Status: Active » Needs review
BenK’s picture

Sub

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

Nice one! Thanks for the patch @derhasi. I'll test and commit next time I'm working on Flag.

quicksketch’s picture

Title: error in SQL Syntax regarding SID » Error in SQL Syntax regarding SID
Status: Reviewed & tested by the community » Fixed

Committed. Thanks @derhasi!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.