Dear Friends,
I have upgraded from Joomla 3 to 4 lately and switched to PHP 8.0. I today upgraded to SuiteCRM 7.13.3 from 7.12.6ā¦ When I was upgrading SuiteCRM there was some message during upgradation process which talked of some language file being in custom folderā¦but I donāt remember which file it was.
I guess, the following are not working in PHP 8.0:
ini_set(ādisplay_errorsā, ā0ā);
ini_set(ādisplay_errorsā, ā1ā);
There was no impact when I added any one of the above codeā¦
The first error which I encountered was:
PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, Lead given in /home4/luminisi/public_html/SuiteCRM/leadCapture_override.php:124
The following solution seems to work is:
//if (array_key_exists($k, $person) || array_key_exists($k, $person->field_defs)) {
if (property_exists($person, $k) || array_key_exists($k, $person->field_defs)) {
Now one more error is emerging in the same file:
Fatal error: Uncaught Error: Attempt to assign property "activity_date" on null in ... leadCapture_override.php on line 141
Here the actual code is this:
$campaign_log->activity_date = $timedate->now();
Surrounding code near this line is:
//create campaign log
$camplog = new CampaignLog();
$camplog->campaign_id = $_POST['campaign_id'];
$camplog->related_id = $person->id;
$camplog->related_type = $person->module_dir;
$camplog->activity_type = $person->object_name;
$camplog->target_type = $person->module_dir;
$campaign_log->activity_date = $timedate->now();
$camplog->target_id = $person->id;
if (isset($marketing_data['id'])) {
$camplog->marketing_id = $marketing_data['id'];
}
$camplog->save();
What should I do now?
Soliciting your helping hand,
With thanks,
RK