Skip to content

Commit 65ccd39

Browse files
dmannersmage2pratik
authored andcommitted
magento/magenot2#15588: add dependency in a backwards compatible way
1 parent 25010d4 commit 65ccd39

File tree

1 file changed

+6
-6
lines changed
  • app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap

1 file changed

+6
-6
lines changed

app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Generate.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Backend\App\Action;
1010
use Magento\Store\Model\App\Emulation;
11+
use Magento\Framework\App\ObjectManager;
1112

1213
class Generate extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
1314
{
@@ -17,16 +18,15 @@ class Generate extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
1718
/**
1819
* Generate constructor.
1920
* @param Action\Context $context
20-
* @param \Magento\Store\Model\App\Emulation $appEmulation
21+
* @param \Magento\Store\Model\App\Emulation|null $appEmulation
2122
*/
2223
public function __construct(
2324
Action\Context $context,
24-
Emulation $appEmulation
25+
Emulation $appEmulation = null
2526
) {
26-
$this->appEmulation = $appEmulation;
27-
parent::__construct(
28-
$context
29-
);
27+
parent::__construct($context);
28+
$this->appEmulation = $appEmulation ?: ObjectManager::getInstance()
29+
->get(\Magento\Store\Model\App\Emulation::class);
3030
}
3131

3232
/**

0 commit comments

Comments
 (0)