owebia / magento2-module-advanced-shipping

Other
90 stars 28 forks source link

Can't access to $app methods #78

Closed mtytula closed 4 years ago

mtytula commented 4 years ago

I'm getting an error, when I'm trying use methods such as isAdminArea(), isFrontendArea(), getAreaCode(). $area->area_code works fine. I've got the newest module version (2.8.0)

Error description: Notice: Undefined index: isAdminArea in /var/www/html/vendor/owebia/magento2-module-advanced-setting-core/Model/Wrapper/ArrayWrapper.php on line 55 Possible fix (works for me):

  1. Modify \Owebia\AdvancedSettingCore\Model\Wrapper\App::loadData($key) method by adding additional switch cases:
    /**
     * {@inheritDoc}
     * @see Wrapper\AbstractWrapper::loadData()
     */
    protected function loadData($key)
    {
        switch ($key) {
            case 'area_code':
                return $this->getAreaCode();
            case 'isFrontendArea':
                return $this->isFrontendArea();
            case 'isAdminArea':
                return $this->isAdminArea();
            default:
                return parent::loadData($key);
        }
    }
owebia commented 4 years ago

Thanks for your feedback, we will provide a fix soon.

Best Regards, A.L.