Skip to content

Commit

Permalink
Replace Magento\Support\Model\Report\Group\Modules\Modules class
Browse files Browse the repository at this point in the history
Usage of `Magento\Support\Model\Report\Group\Modules\Modules` throws
an error during `bin/magento setup:di:compile` due to the class not
existing so replacing it with `Magento\Framework\Module\Manager`.

Change the code to work with the new class.
  • Loading branch information
rikuheinaaho-Pinja committed May 20, 2024
1 parent c456e67 commit a6c68e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Plugin/GetFrontendUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
use Magento\Quote\Model\QuoteIdMaskFactory;
use Magento\Sales\Model\Order;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Support\Model\Report\Group\Modules\Modules;
use Magento\Framework\Module\Manager;
use Paytrail\PaymentService\Controller\Receipt\Index;

class GetFrontendUrl
{
/**
* @param QuoteIdMaskFactory $idMaskFactory
* @param Modules $modules
* @param Manager $moduleManager
* @param ScopeConfigInterface $config
* @param StoreManagerInterface $storeManager
*/
public function __construct(
private readonly QuoteIdMaskFactory $idMaskFactory,
private readonly Modules $modules,
private readonly Manager $moduleManager,
private readonly ScopeConfigInterface $config,
private readonly StoreManagerInterface $storeManager
) {
Expand All @@ -38,7 +38,7 @@ public function __construct(
*/
public function afterGetSuccessUrl(Index $subject, string $result, Order $order): string
{
if ($this->modules->isModuleEnabled('Magento_UpwardConnector')) {
if ($this->moduleManager->isEnabled('Magento_UpwardConnector')) {
$frontendBaseUrl = $this->storeManager->getStore($order->getStoreId())->getBaseUrl(
\Magento\Framework\UrlInterface::URL_TYPE_WEB,
true
Expand Down Expand Up @@ -67,7 +67,7 @@ public function afterGetSuccessUrl(Index $subject, string $result, Order $order)
*/
public function afterGetCartUrl(Index $subject, string $result, Order $order): string
{
if ($this->modules->isModuleEnabled('Magento_UpwardConnector')) {
if ($this->moduleManager->isEnabled('Magento_UpwardConnector')) {
$frontendBaseUrl = $this->storeManager->getStore($order->getStoreId())->getBaseUrl(
\Magento\Framework\UrlInterface::URL_TYPE_WEB,
true
Expand Down

0 comments on commit a6c68e6

Please sign in to comment.