|
11 | 11 | use Magento\Framework\App\Config\ScopeConfigInterface;
|
12 | 12 | use Magento\Framework\Exception\NoSuchEntityException;
|
13 | 13 | use Magento\Customer\Api\GroupRepositoryInterface;
|
| 14 | +use Magento\Framework\App\ObjectManager; |
14 | 15 | use Magento\Store\Model\ScopeInterface;
|
15 | 16 | use Magento\Store\Model\StoreManagerInterface;
|
16 | 17 |
|
@@ -82,13 +83,13 @@ public function __construct(
|
82 | 83 | GroupRepositoryInterface $groupRepository,
|
83 | 84 | CustomerMetadataInterface $customerMetadata,
|
84 | 85 | StoreManagerInterface $storeManager,
|
85 |
| - ScopeConfigInterface $scopeConfig |
| 86 | + ScopeConfigInterface $scopeConfig = null |
86 | 87 | ) {
|
87 | 88 | parent::__construct($attributeValueFactory);
|
88 | 89 | $this->customerMetadata = $customerMetadata;
|
89 | 90 | $this->groupRepository = $groupRepository;
|
90 | 91 | $this->storeManager = $storeManager;
|
91 |
| - $this->scopeConfig = $scopeConfig; |
| 92 | + $this->scopeConfig = $scopeConfig ? $scopeConfig : ObjectManager::getInstance()->create(ScopeConfigInterface::class); |
92 | 93 | }
|
93 | 94 |
|
94 | 95 | /**
|
@@ -182,9 +183,10 @@ private function setConfirmationValue()
|
182 | 183 | ScopeInterface::SCOPE_WEBSITES,
|
183 | 184 | $websiteId);
|
184 | 185 |
|
185 |
| - $valueText = !$isConfirmationRequired ? |
186 |
| - __('Confirmation Not Required') |
187 |
| - : ($value === null ? __('Confirmed') : __('Confirmation Required')); |
| 186 | + $valueText = __('Confirmation Not Required'); |
| 187 | + if ($isConfirmationRequired) { |
| 188 | + $valueText = $value === null ? __('Confirmed') : __('Confirmation Required'); |
| 189 | + } |
188 | 190 |
|
189 | 191 | $this->setCustomAttribute(self::$confirmationAttributeCode, $valueText);
|
190 | 192 | }
|
|
0 commit comments