sql error when sending form

Permalink
Hello, i've got unexpected issue with forms on my website.

After sending a form there is an error :
mysql error: [1064: 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 '{$this->btAnswersTablename} where asID = '4'' at line 1] in EXECUTE("delete from {$this->btAnswersTablename} where asID = '4'")


asID changes with everey form. also no matter which template im using (have 2 of them), this error occurs.

Last time i was checking forms was about 3 months ago and i believe everything was fine... till now.

somebody can help me ? im loosing my hair coz i have no idea how could that happen

grosik
 
goutnet replied on at Permalink Reply
what block are you using ?

sounds like there is an issue in the controller.php file (or did you override it ?)
grosik replied on at Permalink Reply
grosik
Hi, im using standard form block with only css style overriden and i have removed one line (this which shows form's title)in view.php file.

i will try to swap all files connected with forms from clean installation, maybe one of them got corrupted.
Sadu replied on at Permalink Reply
Sadu
I'm having the same problem - looks like a core bug to me.

Seems to be fixable by changing concrete/core/controllers/blocks/form.php (line 431 in 5.6.1.2 but the issue is present in 5.6.0.2 also))

Change from
$db->Execute('delete from {$this->btAnswersTablename} where asID = ?', array($this->lastAnswerSetId));

to
$db->Execute('delete from '.$this->btAnswersTablename.' where asID = ?', array($this->lastAnswerSetId));

I don't normally use braces to insert variables into strings, but my understanding is that only works if you use double quotes.