Page 1 of 1

Log full of PHP Notices from Formbuilder

Posted: Sat Dec 19, 2015 12:12 pm
by geotek
Formbuilder is filling the Apache error log with messages like

Code: Select all

PHP Notice:  Undefined index: captcha_error in /.../tmp/templates_c/FormBuilder^7ec2b3a993f08d0d52f67e4c5cfd6fb41d6e518e.module_db_tpl.FormBuilder;fb_3.php on line 113
PHP Notice:  Trying to get property of non-object in /.../tmp/templates_c/FormBuilder^7ec2b3a993f08d0d52f67e4c5cfd6fb41d6e518e.module_db_tpl.FormBuilder;fb_3.php on line 113
I am not using Captchas and Formbuilder is working as expected but these error messages are annoying because they fill up the logs so that more important errors may pass unnoticed.

Any ideas?

CMSMS V.2.1.0
Formbuilder V.0.8.1.2

Re: Log full of PHP Notices from Formbuilder

Posted: Sat Dec 19, 2015 1:28 pm
by Jo Morg
I would venture saying that the module has been updated a few times on that installation and the templates haven't been updated accordingly. IIRC we have updated the default sample templates with a different call to Captcha and related Smarty variables for FB templates. The fix is simple: just search in your FB template for the offending variable and either remove the related code or check if the variable is set before that block of code. Something like:

Code: Select all

{if isset($captcha_error)}
  {* the template code block that uses {$captcha_error}... *}
{/if}

Re: Log full of PHP Notices from Formbuilder

Posted: Tue Dec 22, 2015 12:24 pm
by JamesT
I saw something similar to what the OP saw when I was testing CMSMS with PHP 7.

Re: Log full of PHP Notices from Formbuilder

Posted: Tue Dec 22, 2015 12:59 pm
by JamesT
I've just had a look at my default FB templates. If I'm not mistaken there are three built in templates:

Default Template
Table Template Titles on left
Table Template Titles on top

Only the first template has {if isset($captcha_error)} - the other two templates use $captcha_error without isset.

Re: Log full of PHP Notices from Formbuilder

Posted: Tue Dec 29, 2015 6:39 pm
by JamesT
On a related note, every time I load the admin interface of Form Builder 0.8.1.2 using PHP 7, I get these PHP errors:

Code: Select all

[29-Dec-2015 18:35:37 Europe/London] PHP Notice:  Undefined index: title_relaxed_email_regex in /var/sites/m/xxxxx.co.uk/public_html/tmp/templates_c/FormBuilder^675f4336c1c1d65e2939016b28258e133bd0192c.module_file_tpl.FormBuilder;AdminMain2.tpl.php on line 183
[29-Dec-2015 18:35:37 Europe/London] PHP Notice:  Trying to get property of non-object in /var/sites/m/xxxxx.co.uk/public_html/tmp/templates_c/FormBuilder^675f4336c1c1d65e2939016b28258e133bd0192c.module_file_tpl.FormBuilder;AdminMain2.tpl.php on line 183
[29-Dec-2015 18:35:37 Europe/London] PHP Notice:  Undefined index: input_relaxed_email_regex in /var/sites/m/xxxxx.co.uk/public_html/tmp/templates_c/FormBuilder^675f4336c1c1d65e2939016b28258e133bd0192c.module_file_tpl.FormBuilder;AdminMain2.tpl.php on line 185
[29-Dec-2015 18:35:37 Europe/London] PHP Notice:  Trying to get property of non-object in /var/sites/m/xxxxx.co.uk/public_html/tmp/templates_c/FormBuilder^675f4336c1c1d65e2939016b28258e133bd0192c.module_file_tpl.FormBuilder;AdminMain2.tpl.php on line 185

Re: Log full of PHP Notices from Formbuilder

Posted: Tue Dec 29, 2015 8:32 pm
by Rolf
@JamesT These are fixed in SVN and will be shipped in the next release of FB

Until then you can suppress the errors by adding to the config.php file:

Code: Select all

error_reporting(E_ERROR & ~E_DEPRECATED & ~E_NOTICE);
(if your host allows it...)

Re: Log full of PHP Notices from Formbuilder

Posted: Wed Dec 30, 2015 10:51 am
by JamesT
Ok, thank you.