Skip to content

Commit 9e63c27

Browse files
committed
Reverted backward incompatible changes
1 parent b30eda5 commit 9e63c27

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/code/Magento/Contact/Controller/Index/Post.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Framework\Exception\LocalizedException;
1515
use Magento\Framework\HTTP\PhpEnvironment\Request;
1616
use Psr\Log\LoggerInterface;
17+
use Magento\Framework\App\ObjectManager;
1718
use Magento\Framework\DataObject;
1819

1920
class Post extends \Magento\Contact\Controller\Index
@@ -56,7 +57,8 @@ public function __construct(
5657
$this->context = $context;
5758
$this->mail = $mail;
5859
$this->dataPersistor = $dataPersistor;
59-
$this->logger = $logger;
60+
$this->logger = $logger ?:
61+
ObjectManager::getInstance()->get(LoggerInterface::class);
6062
}
6163

6264
/**

app/code/Magento/Contact/Model/Mail.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Framework\Mail\Template\TransportBuilder;
99
use Magento\Framework\Translate\Inline\StateInterface;
1010
use Magento\Store\Model\StoreManagerInterface;
11+
use Magento\Framework\App\ObjectManager;
1112
use Magento\Framework\App\Area;
1213

1314
class Mail implements MailInterface
@@ -44,12 +45,13 @@ public function __construct(
4445
ConfigInterface $contactsConfig,
4546
TransportBuilder $transportBuilder,
4647
StateInterface $inlineTranslation,
47-
StoreManagerInterface $storeManager
48+
StoreManagerInterface $storeManager = null
4849
) {
4950
$this->contactsConfig = $contactsConfig;
5051
$this->transportBuilder = $transportBuilder;
5152
$this->inlineTranslation = $inlineTranslation;
52-
$this->storeManager = $storeManager;
53+
$this->storeManager = $storeManager ?:
54+
ObjectManager::getInstance()->get(StoreManagerInterface::class);
5355
}
5456

5557
/**
@@ -70,7 +72,7 @@ public function send($replyTo, array $variables)
7072
->setTemplateIdentifier($this->contactsConfig->emailTemplate())
7173
->setTemplateOptions(
7274
[
73-
'area' => Area::AREA_FRONTEND,
75+
'area' => Area::AREA_FRONTEND,
7476
'store' => $this->storeManager->getStore()->getId()
7577
]
7678
)

0 commit comments

Comments
 (0)