Recent items list has blank entry and E_NOTICE's when viewing an Email activity from activities tab
To reproduce just go to someone's activity tab who has an activity of type Email and click to view it. Then refresh the page or go somewhere else and notice that the recent items list has a blank entry.
Can reproduce on dmaster.demo.
The url that gets generated for activities of type Email in the activities tab is
civicrm/activity/view, which seems lightly used throughout civi. This corresponds to CRM_Activity_Form_ActivityView. What's happening is that in preProcess it's calling CRM_Activity_BAO_Activity::retrieve(), and then later on it's expecting the retrieved values to contain
source_contact_id, but it doesn't.
It seems likely that it used to contain it and something changed, but I'm not sure when and since this particular view url is rarely used it doesn't come up much. Also, when using popups which is the default you don't see the E_notices in the UI unless you open in new tab.
Notice: Undefined index: source_contact_id in CRM_Activity_Form_ActivityView->preProcess() (line 98 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Activity/Form/ActivityView.php). Notice: Undefined property: CRM_Activity_Form_ActivityView::$_values in CRM_Activity_Form_ActivityView->preProcess() (line 99 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Activity/Form/ActivityView.php). Notice: Undefined index: source_contact_id in CRM_Activity_Form_ActivityView->preProcess() (line 103 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Activity/Form/ActivityView.php).
I can do a PR but I wonder if at one time there were efforts to eliminate the use of this particular url and that this form is maybe-not-officially-but-kinda-deprecated-except-maybe-for-emails ??