Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit f66f057

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento-engcom/magento2ce#1358: [EngCom Team] Batch 31. Forwardports to 2.3-develop (by @magento-engcom-team) Fixed GitHub Issues: - magento/magento2#8003: Using System Value for Base Currency Results in Config Error (reported by @tsmith1985) has been fixed in magento-engcom/magento2ce#1358 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 2e90684 2. f99b759 3. 49a3076 4. b754973 5. ed833c4 6. d8b73d3 7. 60e83ea 8. dc69e17 9. 6b9c188 10. 3b58efc 11. 8b40859 12. 11922a1 13. 0bd39d4 14. 8bbb8bb 15. f8307d9 16. 768c769 17. 16a1029 18. 17a26cb 19. 8f1d8e7 20. 5d084ce 21. d248f4e - magento/magento2#10502: Fatal error: Call getTranslateInline of null when generating some sitemap with errors (reported by @Koc) has been fixed in magento-engcom/magento2ce#1358 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 2e90684 2. f99b759 3. 49a3076 4. b754973 5. ed833c4 6. d8b73d3 7. 60e83ea 8. dc69e17 9. 6b9c188 10. 3b58efc 11. 8b40859 12. 11922a1 13. 0bd39d4 14. 8bbb8bb 15. f8307d9 16. 768c769 17. 16a1029 18. 17a26cb 19. 8f1d8e7 20. 5d084ce 21. d248f4e - magento/magento2#11691: Wrong return type for getAttributeText($attributeCode) (reported by @diazwatson) has been fixed in magento-engcom/magento2ce#1358 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 2e90684 2. f99b759 3. 49a3076 4. b754973 5. ed833c4 6. d8b73d3 7. 60e83ea 8. dc69e17 9. 6b9c188 10. 3b58efc 11. 8b40859 12. 11922a1 13. 0bd39d4 14. 8bbb8bb 15. f8307d9 16. 768c769 17. 16a1029 18. 17a26cb 19. 8f1d8e7 20. 5d084ce 21. d248f4e - magento/magento2#12261: Order confirmation email contains non functioning links (reported by @bondimedical3) has been fixed in magento-engcom/magento2ce#1358 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 2e90684 2. f99b759 3. 49a3076 4. b754973 5. ed833c4 6. d8b73d3 7. 60e83ea 8. dc69e17 9. 6b9c188 10. 3b58efc 11. 8b40859 12. 11922a1 13. 0bd39d4 14. 8bbb8bb 15. f8307d9 16. 768c769 17. 16a1029 18. 17a26cb 19. 8f1d8e7 20. 5d084ce 21. d248f4e
2 parents 699d7a1 + 7b0613d commit f66f057

File tree

22 files changed

+602
-33
lines changed

22 files changed

+602
-33
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ To suggest documentation improvements, click [here][4].
3838
| ![reject](http://devdocs.magento.com/common/images/github_reject.png) | The pull request has been rejected and will not be merged into mainline code. Possible reasons can include but are not limited to: issue has already been fixed in another code contribution, or there is an issue with the code contribution. |
3939
| ![bug report](http://devdocs.magento.com/common/images/github_bug.png) | The Magento Team has confirmed that this issue contains the minimum required information to reproduce. |
4040
| ![acknowledged](http://devdocs.magento.com/common/images/gitHub_acknowledged.png) | The Magento Team has validated the issue and an internal ticket has been created. |
41-
| ![acknowledged](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. |
42-
| ![acknowledged](http://devdocs.magento.com/common/images/github_needsUpdate.png) | The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request. |
41+
| ![in progress](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. |
42+
| ![needs update](http://devdocs.magento.com/common/images/github_needsUpdate.png) | The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request. |
43+
44+
To learn more about issue gate labels click [here](https://github.com/magento/magento2/wiki/Magento-Issue-Gates)
4345

4446
<h2>Reporting security issues</h2>
4547

app/code/Magento/Captcha/i18n/en_US.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Always,Always
44
"Incorrect CAPTCHA","Incorrect CAPTCHA"
55
"Incorrect CAPTCHA.","Incorrect CAPTCHA."
66
"The account is locked. Please wait and try again or contact %1.","The account is locked. Please wait and try again or contact %1."
7-
"Please enter the letters from the image","Please enter the letters from the image"
7+
"Please enter the letters and numbers from the image","Please enter the letters and numbers from the image"
88
"<strong>Attention</strong>: Captcha is case sensitive.","<strong>Attention</strong>: Captcha is case sensitive."
99
"Reload captcha","Reload captcha"
10-
"Please type the letters below","Please type the letters below"
10+
"Please type the letters and numbers below","Please type the letters and numbers below"
1111
"Attention: Captcha is case sensitive.","Attention: Captcha is case sensitive."
1212
CAPTCHA,CAPTCHA
1313
"Enable CAPTCHA in Admin","Enable CAPTCHA in Admin"

app/code/Magento/Captcha/view/adminhtml/templates/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $captcha = $block->getCaptchaModel();
1313
?>
1414
<div class="admin__field _required">
1515
<label for="captcha" class="admin__field-label">
16-
<span><?= $block->escapeHtml(__('Please enter the letters from the image')) ?></span>
16+
<span><?= $block->escapeHtml(__('Please enter the letters and numbers from the image')) ?></span>
1717
</label>
1818
<div class="admin__field-control">
1919
<input

app/code/Magento/Captcha/view/frontend/templates/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
$captcha = $block->getCaptchaModel();
1313
?>
1414
<div class="field captcha required" role="<?= $block->escapeHtmlAttr($block->getFormId()) ?>">
15-
<label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?= $block->escapeHtml(__('Please type the letters below')) ?></span></label>
15+
<label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?= $block->escapeHtml(__('Please type the letters and numbers below')) ?></span></label>
1616
<div class="control captcha">
1717
<input name="<?= $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?= $block->escapeHtmlAttr($block->getFormId()) ?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" />
1818
<div class="nested">
@@ -23,7 +23,7 @@ $captcha = $block->getCaptchaModel();
2323
"imageLoader": "<?= $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>",
2424
"type": "<?= $block->escapeHtmlAttr($block->getFormId()) ?>"}}'>
2525
<div class="control captcha-image">
26-
<img alt="<?= $block->escapeHtmlAttr(__('Please type the letters below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/>
26+
<img alt="<?= $block->escapeHtmlAttr(__('Please type the letters and numbers below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/>
2727
<button type="button" class="action reload captcha-reload" title="<?= $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?= $block->escapeHtml(__('Reload captcha')) ?></span></button>
2828
</div>
2929
</div>

app/code/Magento/Captcha/view/frontend/web/template/checkout/captcha.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
-->
77
<!-- ko if: (isRequired() && getIsVisible())-->
88
<div class="field captcha required" data-bind="blockLoader: getIsLoading()">
9-
<label data-bind="attr: {for: 'captcha_' + formId}" class="label"><span data-bind="i18n: 'Please type the letters below'"></span></label>
9+
<label data-bind="attr: {for: 'captcha_' + formId}" class="label"><span data-bind="i18n: 'Please type the letters and numbers below'"></span></label>
1010
<div class="control captcha">
1111
<input name="captcha_string" type="text" class="input-text required-entry" data-bind="value: captchaValue(), attr: {id: 'captcha_' + formId, 'data-scope': dataScope}" />
1212
<input name="captcha_form_id" type="hidden" data-bind="value: formId, attr: {'data-scope': dataScope}" />
1313
<div class="nested">
1414
<div class="field captcha no-label">
1515
<div class="control captcha-image">
1616
<img data-bind="attr: {
17-
alt: $t('Please type the letters below'),
17+
alt: $t('Please type the letters and numbers below'),
1818
height: imageHeight(),
1919
src: getImageSource(),
2020
}"

app/code/Magento/Catalog/Model/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ public function isInStock()
17121712
* Get attribute text by its code
17131713
*
17141714
* @param string $attributeCode Code of the attribute
1715-
* @return string
1715+
* @return string|array|null
17161716
*/
17171717
public function getAttributeText($attributeCode)
17181718
{

app/code/Magento/Catalog/view/adminhtml/web/js/components/dynamic-rows-tier-price.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ define([
99
], function (_, DynamicRows) {
1010
'use strict';
1111

12+
/**
13+
* @deprecated Parent method contains labels sorting.
14+
* @see Magento_Ui/js/dynamic-rows/dynamic-rows
15+
*/
1216
return DynamicRows.extend({
1317

1418
/**

app/code/Magento/Directory/Model/Currency.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Directory\Model;
88

9+
use Magento\Framework\App\ObjectManager;
910
use Magento\Framework\Exception\InputException;
1011
use Magento\Directory\Model\Currency\Filter;
1112

@@ -65,6 +66,11 @@ class Currency extends \Magento\Framework\Model\AbstractModel
6566
*/
6667
protected $_localeCurrency;
6768

69+
/**
70+
* @var CurrencyConfig
71+
*/
72+
private $currencyConfig;
73+
6874
/**
6975
* @param \Magento\Framework\Model\Context $context
7076
* @param \Magento\Framework\Registry $registry
@@ -76,6 +82,7 @@ class Currency extends \Magento\Framework\Model\AbstractModel
7682
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
7783
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
7884
* @param array $data
85+
* @param CurrencyConfig $currencyConfig
7986
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8087
*/
8188
public function __construct(
@@ -88,7 +95,8 @@ public function __construct(
8895
\Magento\Framework\Locale\CurrencyInterface $localeCurrency,
8996
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
9097
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
91-
array $data = []
98+
array $data = [],
99+
CurrencyConfig $currencyConfig = null
92100
) {
93101
parent::__construct(
94102
$context,
@@ -102,6 +110,7 @@ public function __construct(
102110
$this->_directoryHelper = $directoryHelper;
103111
$this->_currencyFilterFactory = $currencyFilterFactory;
104112
$this->_localeCurrency = $localeCurrency;
113+
$this->currencyConfig = $currencyConfig ?: ObjectManager::getInstance()->get(CurrencyConfig::class);
105114
}
106115

107116
/**
@@ -347,7 +356,7 @@ public function getOutputFormat()
347356
*/
348357
public function getConfigAllowCurrencies()
349358
{
350-
$allowedCurrencies = $this->_getResource()->getConfigCurrencies($this, self::XML_PATH_CURRENCY_ALLOW);
359+
$allowedCurrencies = $this->currencyConfig->getConfigCurrencies(self::XML_PATH_CURRENCY_ALLOW);
351360
$appBaseCurrencyCode = $this->_directoryHelper->getBaseCurrencyCode();
352361
if (!in_array($appBaseCurrencyCode, $allowedCurrencies)) {
353362
$allowedCurrencies[] = $appBaseCurrencyCode;
@@ -369,17 +378,15 @@ public function getConfigAllowCurrencies()
369378
*/
370379
public function getConfigDefaultCurrencies()
371380
{
372-
$defaultCurrencies = $this->_getResource()->getConfigCurrencies($this, self::XML_PATH_CURRENCY_DEFAULT);
373-
return $defaultCurrencies;
381+
return $this->currencyConfig->getConfigCurrencies(self::XML_PATH_CURRENCY_DEFAULT);
374382
}
375383

376384
/**
377385
* @return array
378386
*/
379387
public function getConfigBaseCurrencies()
380388
{
381-
$defaultCurrencies = $this->_getResource()->getConfigCurrencies($this, self::XML_PATH_CURRENCY_BASE);
382-
return $defaultCurrencies;
389+
return $this->currencyConfig->getConfigCurrencies(self::XML_PATH_CURRENCY_BASE);
383390
}
384391

385392
/**
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Directory\Model;
8+
9+
use Magento\Framework\App\Area;
10+
use Magento\Framework\App\Config\ScopeConfigInterface;
11+
use Magento\Framework\App\State;
12+
use Magento\Store\Model\ScopeInterface;
13+
use Magento\Store\Model\StoreManagerInterface;
14+
15+
/**
16+
* Provide config values for allowed, base and default currencies.
17+
*/
18+
class CurrencyConfig
19+
{
20+
/**
21+
* @var State
22+
*/
23+
private $appState;
24+
25+
/**
26+
* @var ScopeConfigInterface
27+
*/
28+
private $config;
29+
30+
/**
31+
* @var StoreManagerInterface
32+
*/
33+
private $storeManager;
34+
35+
/**
36+
* CurrencyConfig constructor.
37+
*
38+
* @param State $appState
39+
* @param ScopeConfigInterface $config
40+
* @param StoreManagerInterface $storeManager
41+
*/
42+
public function __construct(
43+
State $appState,
44+
ScopeConfigInterface $config,
45+
StoreManagerInterface $storeManager
46+
) {
47+
$this->appState = $appState;
48+
$this->config = $config;
49+
$this->storeManager = $storeManager;
50+
}
51+
52+
/**
53+
* Retrieve config currency data by config path.
54+
*
55+
* @param string $path
56+
* @return array
57+
*/
58+
public function getConfigCurrencies(string $path)
59+
{
60+
$result = $this->appState->getAreaCode() === Area::AREA_ADMINHTML
61+
? $this->getConfigForAllStores($path)
62+
: $this->getConfigForCurrentStore($path);
63+
sort($result);
64+
65+
return array_unique($result);
66+
}
67+
68+
/**
69+
* Get allowed, base and default currency codes for all stores.
70+
*
71+
* @param string $path
72+
* @return array
73+
*/
74+
private function getConfigForAllStores(string $path)
75+
{
76+
$storesResult = [[]];
77+
foreach ($this->storeManager->getStores() as $store) {
78+
$storesResult[] = explode(
79+
',',
80+
$this->config->getValue($path, ScopeInterface::SCOPE_STORE, $store->getCode())
81+
);
82+
}
83+
84+
return array_merge(...$storesResult);
85+
}
86+
87+
/**
88+
* Get allowed, base and default currency codes for current store.
89+
*
90+
* @param string $path
91+
* @return mixed
92+
*/
93+
private function getConfigForCurrentStore(string $path)
94+
{
95+
$store = $this->storeManager->getStore();
96+
97+
return explode(',', $this->config->getValue($path, ScopeInterface::SCOPE_STORE, $store->getCode()));
98+
}
99+
}

app/code/Magento/Directory/Model/ResourceModel/Currency.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ public function saveRates($rates)
165165
* @param string $path
166166
* @return array
167167
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
168+
* @deprecated because doesn't take into consideration scopes and system config values.
169+
* @see \Magento\Directory\Model\CurrencyConfig::getConfigCurrencies()
168170
*/
169171
public function getConfigCurrencies($model, $path)
170172
{

0 commit comments

Comments
 (0)