Skip to content
Snippets Groups Projects
Commit ce64f7d6 authored by Artem Sylchuk's avatar Artem Sylchuk Committed by Claudiu Cristea
Browse files

Issue #3502162 by artem_sylchuk, zenimagine, pearls: Error occurs after adding...

Issue #3502162 by artem_sylchuk, zenimagine, pearls: Error occurs after adding the private message link to the user display
parent d023eff3
No related branches found
No related tags found
1 merge request!184#3502162 - Added loading the user entity before passing it to the getThreadIdForMembers
Pipeline #408313 passed
......@@ -292,7 +292,8 @@ class PrivateMessageService implements PrivateMessageServiceInterface {
$current_user = $this->currentUser;
if ($current_user->isAuthenticated()) {
if ($current_user->hasPermission('use private messaging system') && $current_user->id() != $author->id()) {
$members = [$current_user, $author];
$user_entity = $this->entityTypeManager->getStorage('user')->load($this->currentUser->id());
$members = [$user_entity, $author];
$thread_id = $this->getThreadIdForMembers($members);
if ($thread_id) {
$url = Url::fromRoute('entity.private_message_thread.canonical', ['private_message_thread' => $thread_id], ['attributes' => ['class' => ['private_message_link']]]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment