Skip to content

Commit 80ae9bd

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop
Accepted Community Pull Requests: - #23787: Fix for PHP_CodeSniffer error after app:config:dump (by @dng-dev) - #23803: Resolve Toggle icon not working in create configuration Product creation Page issue 22702 (by @edenduong) - #23794: Remove duplicate declaration (by @gfernandes410) - #23790: #23789: CommentLevelsSniff works incorrect with @magento_import statement. (by @p-bystritsky) - #23779: Resolve "Discount Amount" field is validated after the page load without any action from user in Create New Catalog Rule form issue23777 (by @edenduong) - #23679: Moved Zero Subtotal Checkout Payment Settings (by @textarea) Fixed GitHub Issues: - #22702: Toggle icon not working in create configuration Product creation Page (reported by @nehaguptacedcoss) has been fixed in #23803 by @edenduong in 2.3-develop branch Related commits: 1. d562572 - #23789: CommentLevelsSniff works incorrect with @magento_import statement. (reported by @p-bystritsky) has been fixed in #23790 by @p-bystritsky in 2.3-develop branch Related commits: 1. a99014e - #23777: "Discount Amount" field is validated after the page load without any action from user in Create New Catalog Rule form (reported by @edenduong) has been fixed in #23779 by @edenduong in 2.3-develop branch Related commits: 1. 4954bd1 - #23678: Can't see "Zero Subtotal Checkout" payment method settings if "Offline Payments" module is disabled (reported by @textarea) has been fixed in #23679 by @textarea in 2.3-develop branch Related commits: 1. 089e24a 2. fb7d3ae
2 parents 167c80f + 766962e commit 80ae9bd

File tree

9 files changed

+74
-48
lines changed

9 files changed

+74
-48
lines changed

app/code/Magento/Backend/Block/Page/RequireJs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public function __construct(
2929
\Magento\Framework\Data\Form\FormKey $formKey,
3030
array $data = []
3131
) {
32-
$this->formKey = $formKey;
3332
parent::__construct(
3433
$context,
3534
$data

app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@
307307
<settings>
308308
<validation>
309309
<rule name="required-entry" xsi:type="boolean">true</rule>
310+
<rule name="validate-number-range" xsi:type="string">0.00-100.00</rule>
310311
</validation>
311312
<dataType>text</dataType>
312313
<label translate="true">Discount Amount</label>

app/code/Magento/OfflinePayments/etc/adminhtml/system.xml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -152,41 +152,6 @@
152152
<label>Sort Order</label>
153153
</field>
154154
</group>
155-
<group id="free" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
156-
<label>Zero Subtotal Checkout</label>
157-
<field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
158-
<label>Enabled</label>
159-
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
160-
</field>
161-
<field id="order_status" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
162-
<label>New Order Status</label>
163-
<source_model>Magento\Sales\Model\Config\Source\Order\Status\Newprocessing</source_model>
164-
</field>
165-
<field id="payment_action" translate="label" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
166-
<label>Automatically Invoice All Items</label>
167-
<source_model>Magento\Payment\Model\Source\Invoice</source_model>
168-
<depends>
169-
<field id="order_status" separator=",">processing</field>
170-
</depends>
171-
</field>
172-
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
173-
<label>Sort Order</label>
174-
<frontend_class>validate-number</frontend_class>
175-
</field>
176-
<field id="title" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
177-
<label>Title</label>
178-
</field>
179-
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
180-
<label>Payment from Applicable Countries</label>
181-
<source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
182-
</field>
183-
<field id="specificcountry" translate="label" type="multiselect" sortOrder="51" showInDefault="1" showInWebsite="1" showInStore="0">
184-
<label>Payment from Specific Countries</label>
185-
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
186-
<can_be_empty>1</can_be_empty>
187-
</field>
188-
<field id="model"></field>
189-
</group>
190155
</section>
191156
</system>
192157
</config>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ Title,Title
2121
"Bank Transfer Payment","Bank Transfer Payment"
2222
Instructions,Instructions
2323
"Cash On Delivery Payment","Cash On Delivery Payment"
24-
"Zero Subtotal Checkout","Zero Subtotal Checkout"
2524
"Automatically Invoice All Items","Automatically Invoice All Items"

app/code/Magento/Payment/etc/adminhtml/system.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,41 @@
1111
<label>Payment Methods</label>
1212
<tab>sales</tab>
1313
<resource>Magento_Payment::payment</resource>
14+
<group id="free" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
15+
<label>Zero Subtotal Checkout</label>
16+
<field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
17+
<label>Enabled</label>
18+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
19+
</field>
20+
<field id="order_status" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
21+
<label>New Order Status</label>
22+
<source_model>Magento\Sales\Model\Config\Source\Order\Status\Newprocessing</source_model>
23+
</field>
24+
<field id="payment_action" translate="label" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
25+
<label>Automatically Invoice All Items</label>
26+
<source_model>Magento\Payment\Model\Source\Invoice</source_model>
27+
<depends>
28+
<field id="order_status" separator=",">processing</field>
29+
</depends>
30+
</field>
31+
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
32+
<label>Sort Order</label>
33+
<frontend_class>validate-number</frontend_class>
34+
</field>
35+
<field id="title" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
36+
<label>Title</label>
37+
</field>
38+
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
39+
<label>Payment from Applicable Countries</label>
40+
<source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
41+
</field>
42+
<field id="specificcountry" translate="label" type="multiselect" sortOrder="51" showInDefault="1" showInWebsite="1" showInStore="0">
43+
<label>Payment from Specific Countries</label>
44+
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
45+
<can_be_empty>1</can_be_empty>
46+
</field>
47+
<field id="model"></field>
48+
</group>
1449
</section>
1550
</system>
1651
</config>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ No,No
5858
"Payment Methods Section","Payment Methods Section"
5959
"Payment Services","Payment Services"
6060
"Payment Methods","Payment Methods"
61+
"Zero Subtotal Checkout","Zero Subtotal Checkout"

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@
122122
&:before {
123123
content: @icon-expand-close__content;
124124
}
125+
&.active {
126+
&:before {
127+
content: @icon-expand-open__content;
128+
}
129+
}
125130
}
126131
}
127132

dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Sniffs\Less;
77

8-
use PHP_CodeSniffer\Sniffs\Sniff;
98
use PHP_CodeSniffer\Files\File;
9+
use PHP_CodeSniffer\Sniffs\Sniff;
1010

1111
/**
1212
* Class CommentLevelsSniff
@@ -72,14 +72,7 @@ public function process(File $phpcsFile, $stackPtr)
7272
return;
7373
}
7474

75-
// validation of levels comments
76-
if (!in_array($tokens[$stackPtr + 1]['content'], [
77-
TokenizerSymbolsInterface::DOUBLE_WHITESPACE,
78-
TokenizerSymbolsInterface::NEW_LINE,
79-
])
80-
) {
81-
$phpcsFile->addError('Level\'s comment does not have 2 spaces after "//"', $stackPtr, 'SpacesMissed');
82-
}
75+
$this->validateCommentLevel($phpcsFile, $stackPtr, $tokens);
8376

8477
if (!$this->isNthLevelComment($phpcsFile, $stackPtr, $tokens)) {
8578
return;
@@ -195,4 +188,27 @@ private function checkNthLevelComment(File $phpcsFile, $stackPtr, array $tokens)
195188

196189
return $correct;
197190
}
191+
192+
/**
193+
* Validation of comment level.
194+
*
195+
* @param File $phpcsFile
196+
* @param int $stackPtr
197+
* @param array $tokens
198+
*/
199+
private function validateCommentLevel(File $phpcsFile, int $stackPtr, array $tokens): void
200+
{
201+
if ($tokens[$stackPtr + 2]['content'] !== 'magento_import' &&
202+
!in_array(
203+
$tokens[$stackPtr + 1]['content'],
204+
[
205+
TokenizerSymbolsInterface::DOUBLE_WHITESPACE,
206+
TokenizerSymbolsInterface::NEW_LINE,
207+
],
208+
true
209+
)
210+
) {
211+
$phpcsFile->addError('Level\'s comment does not have 2 spaces after "//"', $stackPtr, 'SpacesMissed');
212+
}
213+
}
198214
}

lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ class PhpFormatter implements FormatterInterface
1818

1919
/**
2020
* Format deployment configuration.
21+
*
2122
* If $comments is present, each item will be added
2223
* as comment to the corresponding section
2324
*
24-
* {@inheritdoc}
25+
* @inheritdoc
2526
*/
2627
public function format($data, array $comments = [])
2728
{
@@ -71,6 +72,8 @@ private function formatData($data, $comments = [], $prefix = ' ')
7172
}
7273

7374
/**
75+
* Format generated config files using the short array syntax.
76+
*
7477
* If variable to export is an array, format with the php >= 5.4 short array syntax. Otherwise use
7578
* default var_export functionality.
7679
*
@@ -80,7 +83,9 @@ private function formatData($data, $comments = [], $prefix = ' ')
8083
*/
8184
private function varExportShort($var, int $depth = 0)
8285
{
83-
if (!is_array($var)) {
86+
if (null === $var) {
87+
return 'null';
88+
} elseif (!is_array($var)) {
8489
return var_export($var, true);
8590
}
8691

0 commit comments

Comments
 (0)