Avoid type error when importing events with IDs that cannot be read (no permission)

Argument 1 passed to calendar_tracking::changed_fields() must be of the type array, null given
This commit is contained in:
nathangray 2016-07-25 12:23:31 -06:00
parent 085ac5bb38
commit 0405eb1510

View File

@ -275,10 +275,13 @@ class calendar_import_csv extends importexport_basic_import_csv {
}
// Merge to deal with fields not in import record
$_data = array_merge($old, $_data);
$changed = $this->tracking->changed_fields($_data, $old);
if(count($changed) == 0) {
return true;
if($old)
{
$_data = array_merge($old, $_data);
$changed = $this->tracking->changed_fields($_data, $old);
if(count($changed) == 0) {
return true;
}
}
// Fall through
case 'insert' :