diff --git a/projects/plugins/crm/admin/dashboard/main.page.php b/projects/plugins/crm/admin/dashboard/main.page.php index cf0744071f368..080951c2102d3 100644 --- a/projects/plugins/crm/admin/dashboard/main.page.php +++ b/projects/plugins/crm/admin/dashboard/main.page.php @@ -256,8 +256,12 @@ function jpcrm_render_dashboard_page() { $last_x_ago = ''; foreach ( $latest_logs as $log ) { - $em = zeroBS_customerEmail( $log['owner'] ); - $avatar = zeroBSCRM_getGravatarURLfromEmail( $em, 28 ); + $log_avatar = ''; + $log_wp_user = get_userdata( $log['owner'] ); + // If the WP user still exists, grab their email and generate a gravatar URL. + if ( $log_wp_user ) { + $log_avatar = zeroBSCRM_getGravatarURLfromEmail( $log_wp_user->user_email, 28 ); + } $unixts = gmdate( 'U', strtotime( $log['created'] ) ); $diff = human_time_diff( $unixts, current_time( 'timestamp' ) ); // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested @@ -289,7 +293,13 @@ function jpcrm_render_dashboard_page() { } ?>
- <?php esc_attr_e( 'Contact Image', 'zero-bs-crm' ); ?> + + <?php esc_attr_e( 'Contact Image', 'zero-bs-crm' ); ?> +
array( 'class' => true ) ) ); ?>
diff --git a/projects/plugins/crm/changelog/fix-crm-php_error_on_dash b/projects/plugins/crm/changelog/fix-crm-php_error_on_dash new file mode 100644 index 0000000000000..25d1f6ffc89d3 --- /dev/null +++ b/projects/plugins/crm/changelog/fix-crm-php_error_on_dash @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Dashboard: Show correct avatar for recent activity. diff --git a/projects/plugins/crm/includes/ZeroBSCRM.GeneralFuncs.php b/projects/plugins/crm/includes/ZeroBSCRM.GeneralFuncs.php index 7947229ad0f98..c028464e10f61 100644 --- a/projects/plugins/crm/includes/ZeroBSCRM.GeneralFuncs.php +++ b/projects/plugins/crm/includes/ZeroBSCRM.GeneralFuncs.php @@ -670,27 +670,27 @@ function jpcrm_inject_contacts( $contacts, $args ) { $injected_contacts = array( array( 'id' => 0, - 'name' => '', + 'name' => 'Project Oz 🌈', ), array( 'id' => -1, - 'name' => 'Wizard of Oz', + 'name' => 'Dorothy 👠', ), array( 'id' => -2, - 'name' => 'Dorothy', + 'name' => 'Toto the Dog 🐶', ), array( 'id' => -3, - 'name' => 'Toto the Dog', + 'name' => 'Scarecrow 🧑‍🌾', ), array( 'id' => -4, - 'name' => 'Scarecrow', + 'name' => 'Tin Man 🤖', ), array( 'id' => -5, - 'name' => 'Tin Man', + 'name' => 'Cowardly Lion 🦁', ), ); }