Skip to content

Commit d2039f2

Browse files
committed
magento/graphql-ce#761: [Customizable Options] Call to a member function format() on boolean
1 parent 0809b69 commit d2039f2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/code/Magento/CatalogGraphQl/Model/Product/Option/DateType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
/**
1616
* CatalogGraphQl product option date type
17+
*
18+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1719
*/
1820
class DateType extends ProductDateOptionType
1921
{

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public function testAddSimpleProductWithOptions()
5858
$customOptionsValues = $this->getCustomOptionsValuesForQueryBySku->execute($sku);
5959
/* Generate customizable options fragment for GraphQl request */
6060
$queryCustomizableOptionValues = preg_replace(
61-
'/"([^"]+)"\s*:\s*/', '$1:',
61+
'/"([^"]+)"\s*:\s*/',
62+
'$1:',
6263
json_encode(array_values($customOptionsValues))
6364
);
6465

@@ -118,7 +119,8 @@ public function testAddSimpleProductWithWrongDateOptionFormat()
118119
$customOptionsValues = $this->getCustomOptionsValuesForQueryBySku->execute($sku);
119120
$customOptionsValues['date']['value_string'] = '12-12-12';
120121
$queryCustomizableOptionValues = preg_replace(
121-
'/"([^"]+)"\s*:\s*/', '$1:',
122+
'/"([^"]+)"\s*:\s*/',
123+
'$1:',
122124
json_encode(array_values($customOptionsValues))
123125
);
124126
$customizableOptions = "customizable_options: {$queryCustomizableOptionValues}";

0 commit comments

Comments
 (0)