Skip to content

Commit 9a2bb63

Browse files
committed
B2B-2255: "Currency" GraphQl query has no cache identity
1 parent 8812b70 commit 9a2bb63

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

app/code/Magento/DirectoryGraphQl/Model/Cache/Tag/Strategy/CurrencyConfig.php

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

88
namespace Magento\DirectoryGraphQl\Model\Cache\Tag\Strategy;
99

10-
use Magento\CurrencySymbol\Model\System\Currencysymbol;
11-
use Magento\Directory\Model\Currency;
1210
use Magento\DirectoryGraphQl\Model\Resolver\Currency\Identity;
1311
use Magento\Framework\App\Cache\Tag\StrategyInterface;
1412
use Magento\Framework\App\Config\ValueInterface;
@@ -18,11 +16,14 @@
1816
*/
1917
class CurrencyConfig implements StrategyInterface
2018
{
19+
/**
20+
* @var string[]
21+
*/
2122
private $currencyConfigPaths = [
22-
Currency::XML_PATH_CURRENCY_BASE,
23-
Currency::XML_PATH_CURRENCY_DEFAULT,
24-
Currency::XML_PATH_CURRENCY_ALLOW,
25-
Currencysymbol::XML_PATH_CUSTOM_CURRENCY_SYMBOL
23+
'currency/options/base',
24+
'currency/options/default',
25+
'currency/options/allow',
26+
'currency/options/customsymbol'
2627
];
2728

2829
/**
@@ -34,8 +35,7 @@ public function getTags($object): array
3435
throw new \InvalidArgumentException('Provided argument is not an object');
3536
}
3637

37-
if (
38-
$object instanceof ValueInterface
38+
if ($object instanceof ValueInterface
3939
&& in_array($object->getPath(), $this->currencyConfigPaths)
4040
&& $object->isValueChanged()
4141
) {

app/code/Magento/DirectoryGraphQl/Model/Resolver/Currency/Identity.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ class Identity implements IdentityInterface
1616
*/
1717
public const CACHE_TAG = 'gql_currency';
1818

19+
/**
20+
* @inheritdoc
21+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
22+
*/
1923
public function getIdentities(array $resolvedData): array
2024
{
2125
return [self::CACHE_TAG];

app/code/Magento/DirectoryGraphQl/Plugin/Currency.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function __construct(ManagerInterface $eventManager)
3636
* @param CurrencyModel $subject
3737
* @param CurrencyModel $result
3838
* @return CurrencyModel
39+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3940
*/
4041
public function afterSaveRates(CurrencyModel $subject, CurrencyModel $result): CurrencyModel
4142
{

0 commit comments

Comments
 (0)