CRMEntity Bug in insertIntoEntityTable()
See this line:
https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/data/CRMEntity.php#L673
Note the use of the variable $tableKey. This variable is defined inside the test here:
https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/data/CRMEntity.php#L415
Note that $tableKey only gets defined if $insertion_mode == "edit".
Now to reproduce the error, go to an existing product with an image, duplicate it, and remove the image in the duplicate, then save it. The save is not in edit mode so the $tableKey var is never defined.