V8.3.0 Lead Generation Form Produces Error 500 on Submission

PHP 8.0.28 (PHP-FPM)
MariaDB 10.4
Apache 2.4.37
Rocky Linux 8.6

I created a lead form using the Web To Person generator in the Campaign Module, grabbed the output and created a HTML file to test the output. I’m getting an Error 500 on submission.

This is the error it throws in the logs.

	954216#0: *49662 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, Lead given in /var/www/vhosts/mydomain.net/subdomains/crm/public/legacy/modules/Campaigns/WebToPersonCapture.php:146
Stack trace:
#0 /var/www/vhosts/mydomain.net/subdomains/crm/public/legacy/include/MVC/Controller/SugarController.php(1010): require_once()
#1 /var/www/vhosts/mydomain.net/subdomains/crm/public/legacy/include/MVC/Controller/SugarController.php(465): SugarController->handleEntryPoint()
#2 /var/www/vhosts/mydomain.net/subdomains/crm/public/legacy/include/MVC/Controller/SugarController.php(361): SugarController->process()
#3 /var/www/vhosts/mydomain.net/subdomains/crm/public/legacy/include/MVC/SugarApplication.php(101): SugarController->execute()
#4 /var/www/vhosts/mydomain.net/subdomains/crm/public/legacy/index.php(52): SugarApplication->execute()
#5 /var/www/vhosts/mydomain.net/subdomains/crm/public/index.php(54): require('...')
#6 {main}" while reading response header from upstream

Set all files temporary to 777 to eliminate permission errors, did not fix.
Raised memory to 512MB, did not fix.

UPDATE: Downgrading to PHP 7.4 everything thing works properly. I’ll file a bug report.

Submitted:

1 Like

I have found the solution to this bug and verified it works.

Edit the file: modules/Campaigns/WebToPersonCapture.php on line 146

Replace
if (array_key_exists($k, $person) || array_key_exists($k, $person->field_defs)) {

With
if (property_exists($person, $k) || array_key_exists($k, $person->field_defs)) {

NOTE: This is not upgrade safe and if SuiteCRM doesn’t correct this before the next release, you’ll have to re-apply this fix.

1 Like