Skip to content

Commit

Permalink
Fix access to Staff creation panel. Closes #1741 (#1935)
Browse files Browse the repository at this point in the history
Fix to "gravatar" attribute in Staff model, required to avoid errors
while accessing the Staff's creation panel.

Cfr. #1741
  • Loading branch information
madbob authored Sep 11, 2024
1 parent 917ff5a commit 467b497
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/admin/src/Models/Staff.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ public function getFullNameAttribute()
*/
public function getGravatarAttribute()
{
$hash = md5(strtolower(trim($this->attributes['email'])));
if (isset($this->attributes['email'])) {
$hash = md5(strtolower(trim($this->attributes['email'])));
}
else {
$hash = '';
}

return "https://www.gravatar.com/avatar/$hash?d=mp";
}
Expand Down

0 comments on commit 467b497

Please sign in to comment.