Import Leads Problem

On 7.14.5 (on three different installs, so I’m pretty sure it’s a bug) when I import leads I get this error output for every record:

Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: Undefined property: Lead::$assistant
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: Undefined property: Lead::$accept_status_id
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: Undefined property: Lead::$event_invite_id
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: Undefined property: Lead::$event_status_id
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: Undefined property: Lead::$num_employees_c
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: Undefined property: Lead::$jjwg_maps_geocode_status_c
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: Undefined property: SugarFeed::$link_url
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: Undefined property: SugarFeed::$link_type
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: stat(): stat failed for upload/import/status_1.csv
Wed Feb 19 21:37:06 2025 [14631][1][FATAL] Caught error: touch(): UploadStream::stream_metadata is not implemented!

I’ve tried just importing first name, last name, email address and only a few records an get this every time. The records seem to import OK, just it errors out so I miss all the final totals and the ability to download what was not imported.

Anyone else?

(As a side note, it works fine in SuiteCRM 8 with the same data)

Is this similar issue?

Looks similar type of errors, but that has to do with list view, not importation. As well, he’s reporting errors in browser console. I’m experiencing them right in the dialog box in the import wizard.

I also just tested and reverting back to PHP 7.4 the issue goes away!!!

So this is a PHP 8 issue.

PHP 8.1 or PHP 8.2? Which one you’re using?

So I think what’s going on here is that the import function is passing null variables to Sugarbean.php. In PHP 7.4 this only produces a warning but not fatal error.

In PHP 8+ this is a scrict warning and is probably breaking execution.

So… now I have to figure out which direction to hunt in?

@pgr this is one of those situations where I need your expert counsel (you told me I could ask any time). From a developer perspecive, is it better to fix Sugarbean to allow it to be passed null variables and just skip them, or is it better to fix the import function to stop passing null variables?

Or as a workaround, I haven’t tried is suppressing error reporting in the php.ini (I’m going to try that to, however it’s a bandaid if it works).

Ok I can confirm that addding:

error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE

to php.ini for the install directory allows the import to proceed now and finish properly. This gets me by for today, but this issue I’d really like to dive into further and solve. I can only assume future versions of PHP will be more strict and may cause this to fail.

Just found out on another server environment I had to add addtional error suppression. PHP 8 introduces E_USER_WARNING and that has to be supressed too:

error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_USER_WARNING

1 Like

That’s new! I never read about ~E_USER_WARNING

E_USER_WARNING (int)
User-generated warning message. This is like an E_WARNING, except it is generated in PHP code by using the PHP function trigger_error(). Value of the constant: 512

Yeah I learned something new today too!