- Issue created by @veverka42
- Merge request !5fix for "error is shown in case user has no image" issue → (Open) created by veverka42
In case a user has no image (avatar), the following error is shown
Warning: Undefined variable $imageMimeType in Drupal\user_menu_avatar\Services\UserMenuAvatarServices->getFieldImage() (line 133 of modules/contrib/user_menu_avatar/src/Services/UserMenuAvatarServices.php).
From the user configuration, remove the user image. Error is shown...
Fix the code, modifying the code near line 133 as following
// Get the default image URI from settings.
$image = $this->entityRepository
->loadEntityByUuid('file', $imageGetSettings['uuid']);
// Get image mime type.
$imageMimeType = $image->getMimeType();
// Get image file URI.
$uri = $image->getFileUri();
Active
9.0
Code