[Fix lỗi] Magento 2: Area is already set

Magento 2.2.4: Something went wrong while saving this configuration: Area is already set

[Fix Lỗi] Magento 2: Area Is Already Set | (Hình 2)

Magento 2.2.4 bị lỗi khi thay theme:

Something went wrong while saving this configuration: Area is already set

Lỗi này được được phát hiện sau khi nâng cấp từ Magento 2.2.3 lên, sẽ làm ta không thể thay đổi Themes Magento được. Vậy cách xử lý như thế nào?

Cách xử lý tạm thời như sau:

  1. Edit file này
/vendor/magento/module-email/Model/AbstractTemplate.php

từ

public function setForcedArea($templateId)
{
    if ($this->area) {
        throw new \LogicException(__('Area is already set'));
    }
    $this->area = $this->emailConfig->getTemplateArea($templateId);
    return $this;
}

thành

public function setForcedArea($templateId)
{
    if (!isset($this->area)) {
        $this->area = $this->emailConfig->getTemplateArea($templateId);
    }
    return $this;
}

Lưu lại và Test thử nhé

Đăng ký nhận bản tin qua Email

Đừng lo lắng, chúng tôi không bán thông tin cho đơn vị khác

Gafaba.com
Gafaba.com

Thích chia sẻ, thích nghiên cứu, thích đủ thứ...

Nhận thông báo
Thông báo cho tôi khi
guest

0 Bình luận
Inline Feedbacks
View all comments
Gafaba.com
Logo
Compare items
  • Total (0)
Compare