Error when submitting webtolead form

Hi!
I have a webtolead form and multiselect field in there. When i submit it i get an error “mysqli_real_escape_string() expects parameter 2 to be string” and info from multiselect field doesn’t get to leads. How can i solve this problem?

I’ve seen this bug and it’s already solved on Github, but I’m not sure on which version it was released.

That’s why if you post your versions when you ask stuff on the forums, it really helps…

SuiteCRM version is 7.8.2

Sorry, I’ve been looking but I can’t find any fix, I just see other people reporting similar errors.

It would help if you had any further detail from the logs (especially a line number where that’s occurring), either suitecrm.log or php_errrors.log.

And what is your MySQL version and PHP version? Some people report this error only occurring in older versions of PHP…

Thanks for answer!
My PHP version is 5.6 and MySQL is 5.5
Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in D:\OpenServer\OpenServer\domains\localhost\SuiteCRM-7.8.2\include\database\MysqliManager.php on line 260

In suitecrm.log i didn’t find anything related to the issue.

If that comes form php_errors.log, then you should probably see a stack trace there also. These are the lines following that error, showing which functions are calling the offending code.

If you can post that also, it would be helpful. We know somebody is passing a wrong parameter to the database manager, now we need to see who it is…

it looks something like this:

[15-Jan-2017 12:50:40 Europe/Lisbon] PHP Fatal error:  Uncaught Error: Call to undefined function sugar_is_dir() in /var/www/html/include/SugarLogger/LoggerManager.php:194

Stack trace:
#0 /var/www/html/include/SugarLogger/LoggerManager.php(81): LoggerManager->_findAvailableLoggers()
#1 /var/www/html/include/SugarLogger/LoggerManager.php(167): LoggerManager->__construct()
#2 /var/www/html/include/entryPoint.php(153): LoggerManager::getLogger()
#3 /var/www/html/index.php(47): require_once('/var/www/html/i...')
#4 {main}
  thrown in /var/www/html/include/SugarLogger/LoggerManager.php on line 194

that’s from a different error I found in my log, I’m just trying to show how the errors are part of group with the stack trace that follows. Please post the whole thing from your error.

I’ve found these errors

[02-May-2017 13:50:50 Europe/Moscow] PHP Warning:  Illegal string offset 'cookie_name' in D:\OpenServer\OpenServer\domains\localhost\SuiteCRM-7.8.2\cache\smarty\templates_c\%%E2^E2B^E2BC33C5%%SubPanelTiles.tpl.php on line 41

[02-May-2017 13:50:50 Europe/Moscow] PHP Warning:  Illegal string offset 'cookie_name' in D:\OpenServer\OpenServer\domains\localhost\SuiteCRM-7.8.2\cache\smarty\templates_c\%%E2^E2B^E2BC33C5%%SubPanelTiles.tpl.php on line 41

[02-May-2017 13:50:50 Europe/Moscow] PHP Warning:  Illegal string offset 'cookie_name' in D:\OpenServer\OpenServer\domains\localhost\SuiteCRM-7.8.2\cache\smarty\templates_c\%%E2^E2B^E2BC33C5%%SubPanelTiles.tpl.php on line 41

[02-May-2017 13:50:50 Europe/Moscow] PHP Warning:  Illegal string offset 'cookie_name' in D:\OpenServer\OpenServer\domains\localhost\SuiteCRM-7.8.2\cache\smarty\templates_c\%%E2^E2B^E2BC33C5%%SubPanelTiles.tpl.php on line 41

[02-May-2017 13:55:25 Europe/Moscow] PHP Warning:  Creating default object from empty value in D:\OpenServer\OpenServer\domains\localhost\SuiteCRM-7.8.2\modules\Campaigns\WebToPersonCapture.php on line 139

[02-May-2017 13:55:25 Europe/Moscow] PHP Warning:  mysqli_real_escape_string() expects parameter 2 to be string, array given in D:\OpenServer\OpenServer\domains\localhost\SuiteCRM-7.8.2\include\database\MysqliManager.php on line 260

Hope it is what you asked.

No, it’s not what I’m looking for - but the problem seems to be your log (I’m assuming it’s php_errors.log) is not including stack traces for some reason. Unless that output is coming from a grep command, is it?

Those cookie_name errors are log spam, everybody gets thousands of those… : - (

I’m sorry, I’m trying to be helpful but I’m running out of options here… if you can reproduce your problem on an online demo, you could try opening an Issue on Github listing the steps to reproduce it. But it might be hard to do because web-to-lead might be tough to set up on a demo.

Ok. Thank you so much.
Maybe i found wrong file? Could you kindly say where is a location of your php_errors.log?

I have one queistion too - if you could answer i’ll be very happy, i just don’t know already who can help me.
I have module Meetings and several meetings in it. And i have webtocontacts form for registration to every meeting. And i need, for example, if a person registred to one meeting the system should create relationship between this contact and the meeting. And this way with every meeting and registration. I understand that should do it via logic hooks, but can’t get it exactly.

I’m sorry, I haven’t done anything like that, I don’t know.

Maybe you could do it with Workflows?

I also think there’s a concept called “Events” in SuiteCRM which is that sort of thing, it lets you send out invites by email and check who’s attending. I’m not sure how it could connect to a web form.

Perhaps check out also this add-on: https://store.suitecrm.com/addons/webtomodule?tag=urdhvatech

That user (urdhvatech) is also active in these forums, he might help you if you start this question on a new thread.