![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/amasty/base/Plugin/Adminhtml/Block/Widget/Form/Element/ |
<?php /** * @author Amasty Team * @copyright Copyright (c) Amasty (https://www.amasty.com) * @package Magento 2 Base Package */ namespace Amasty\Base\Plugin\Adminhtml\Block\Widget\Form\Element; use Magento\Backend\Block\Widget\Form\Element; /** * Fix group dependence on old Magento */ class Dependence { /** * @var \Magento\Framework\App\ProductMetadataInterface */ private $productMetadata; public function __construct(\Magento\Framework\App\ProductMetadataInterface $productMetadata) { $this->productMetadata = $productMetadata; } /** * @param Element\Dependence $subject * @param \Closure $proceed * @param $fieldName * @param $fieldNameFrom * @param $refField * @return Element\Dependence */ public function aroundAddFieldDependence( Element\Dependence $subject, \Closure $proceed, $fieldName, $fieldNameFrom, $refField ) { if (version_compare($this->productMetadata->getVersion(), '2.2.0', '<') && strpos($fieldName, 'groups[][fields]') !== false ) { return $subject; } return $proceed($fieldName, $fieldNameFrom, $refField); } }