Skip to content
Snippets Groups Projects
Commit e4ed1d74 authored by Taras Kravchuk's avatar Taras Kravchuk Committed by Claudiu Cristea
Browse files

Issue #3337216 by _tarik_, alorenc, zaryab_drupal, claudiu.cristea, dd_diablo,...

Issue #3337216 by _tarik_, alorenc, zaryab_drupal, claudiu.cristea, dd_diablo, bohart: Replace PrivateMessageThread::load with dependency injection
parent f7711c32
No related branches found
No related tags found
1 merge request!57Issue #3337216: DI problems
Pipeline #342136 canceled
......@@ -20,7 +20,6 @@ use Drupal\private_message\Ajax\PrivateMessageInsertThreadCommand;
use Drupal\private_message\Ajax\PrivateMessageMemberUsernameValidatedCommand;
use Drupal\private_message\Ajax\PrivateMessageMembersAutocompleteResponseCommand;
use Drupal\private_message\Ajax\PrivateMessageUpdateUnreadItemsCountCommand;
use Drupal\private_message\Entity\PrivateMessageThread;
use Drupal\private_message\Service\PrivateMessageBanManagerInterface;
use Drupal\private_message\Service\PrivateMessageServiceInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -435,7 +434,7 @@ class AjaxController extends ControllerBase implements AjaxControllerInterface {
protected function loadThread(AjaxResponse $response) {
$thread_id = $this->requestStack->getCurrentRequest()->get('id');
if ($thread_id) {
$thread = PrivateMessageThread::load($thread_id);
$thread = $this->entityTypeManager->getStorage('private_message_thread')->load($thread_id);
if ($thread && $thread->access('view', $this->currentUser)) {
$this->privateMessageService->updateLastCheckTime();
......
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