Skip to content

Commit 576afcb

Browse files
author
Bohdan Korablov
committed
MAGETWO-57820: [GITHUB] php bin/magento i18n:pack creates unwanted dir #6260
2 parents 3a5c5c2 + 21d4316 commit 576afcb

File tree

131 files changed

+1298
-700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+1298
-700
lines changed

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,7 @@ protected function getBundleOptions()
342342
'selection_price_value' => '',
343343
'selection_qty' => '',
344344
],
345-
'links' => [
346-
'insertData' => '${ $.provider }:${ $.dataProvider }'
347-
],
345+
'links' => ['insertData' => '${ $.provider }:${ $.dataProvider }'],
348346
'source' => 'product',
349347
'addButton' => false,
350348
],
@@ -588,10 +586,7 @@ protected function getBundleSelections()
588586
'prefer' => 'radio',
589587
'value' => '0',
590588
'sortOrder' => 50,
591-
'valueMap' => [
592-
'false' => '0',
593-
'true' => '1'
594-
]
589+
'valueMap' => ['false' => '0', 'true' => '1']
595590
],
596591
],
597592
],
@@ -642,7 +637,8 @@ protected function getBundleSelections()
642637
'sortOrder' => 100,
643638
'validation' => [
644639
'required-entry' => true,
645-
'validate-zero-or-greater' => true
640+
'validate-number' => true,
641+
'validate-greater-than-zero' => true
646642
],
647643
'imports' => [
648644
'isInteger' => '${ $.provider }:${ $.parentScope }.selection_qty_is_integer'

app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/type/bundle/option/checkbox.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<input class="bundle-option-<?php /* @escapeNotVerified */ echo $_option->getId() ?> checkbox product bundle option change-container-classname"
3030
id="bundle-option-<?php /* @escapeNotVerified */ echo $_option->getId() ?>-<?php /* @escapeNotVerified */ echo $_selection->getSelectionId() ?>"
3131
type="checkbox"
32-
<?php if ($_option->getRequired()) echo 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' . $_option->getId() . ']&quot;]:checked\'}"'?>
32+
<?php if ($_option->getRequired()) /* @escapeNotVerified */ echo 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' . $_option->getId() . ']&quot;]:checked\'}"'?>
3333
name="bundle_option[<?php /* @escapeNotVerified */ echo $_option->getId() ?>][<?php /* @escapeNotVerified */ echo $_selection->getId() ?>]"
3434
data-selector="bundle_option[<?php /* @escapeNotVerified */ echo $_option->getId() ?>][<?php /* @escapeNotVerified */ echo $_selection->getId() ?>]"
3535
<?php if ($block->isSelected($_selection)) echo ' checked="checked"' ?>

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

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

77
// @codingStandardsIgnoreFile
88

9+
/** @var \Magento\Captcha\Block\Captcha\DefaultCaptcha $block */
10+
11+
/** @var \Magento\Captcha\Model\DefaultModel $captcha */
12+
$captcha = $block->getCaptchaModel();
913
?>
10-
<?php /* @var $captcha \Magento\Captcha\Model\DefaultModel */ ?>
11-
<?php /* @var $block \Magento\Captcha\Block\Captcha\DefaultCaptcha */ ?>
12-
<?php $captcha = $block->getCaptchaModel() ?>
1314
<div class="admin__field _required">
1415
<label for="captcha" class="admin__field-label">
15-
<span><?php /* @escapeNotVerified */ echo __('Please enter the letters from the image') ?></span>
16+
<span><?php echo $block->escapeHtml(__('Please enter the letters from the image')) ?></span>
1617
</label>
1718
<div class="admin__field-control">
1819
<input
@@ -23,7 +24,7 @@
2324
data-validate="{required:true}"/>
2425
<?php if ($captcha->isCaseSensitive()) :?>
2526
<div class="admin__field-note">
26-
<span><?php /* @escapeNotVerified */ echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?></span>
27+
<span><?php echo $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) ?></span>
2728
</div>
2829
<?php endif; ?>
2930
</div>
@@ -33,7 +34,7 @@
3334
id="captcha-reload"
3435
class="captcha-reload"
3536
src="<?php echo $block->escapeUrl($block->getViewFileUrl('Magento_Captcha::reload.png')) ?>"
36-
alt="<?php /* @escapeNotVerified */ echo __('Reload captcha') ?>"/>
37+
alt="<?php echo $block->escapeHtmlAttr(__('Reload captcha')) ?>"/>
3738
<img
3839
id="<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>"
3940
width="<?php /* @noEscape */ echo (float) $block->getImgWidth() ?>"
@@ -44,7 +45,7 @@
4445
require(["prototype", "mage/captcha"], function(){
4546

4647
//<![CDATA[
47-
var captcha = new Captcha('<?php echo $block->escapeUrl($block->getRefreshUrl()) ?>', '<?php echo $block->escapeJs($block->getFormId()) ?>');
48+
var captcha = new Captcha('<?php echo $block->escapeJs($block->escapeUrl($block->getRefreshUrl())) ?>', '<?php echo $block->escapeJs($block->escapeHtml($block->getFormId())) ?>');
4849

4950
$('captcha-reload').observe('click', function () {
5051
captcha.refresh(this);

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

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

77
// @codingStandardsIgnoreFile
88

9+
/** @var \Magento\Captcha\Block\Captcha\DefaultCaptcha $block */
10+
11+
/** @var \Magento\Captcha\Model\DefaultModel $captcha */
12+
$captcha = $block->getCaptchaModel();
913
?>
10-
<?php /* @var $captcha \Magento\Captcha\Model\DefaultModel */ ?>
11-
<?php /* @var $block \Magento\Captcha\Block\Captcha\DefaultCaptcha */ ?>
12-
<?php $captcha = $block->getCaptchaModel() ?>
1314
<div class="field captcha required" role="<?php echo $block->escapeHtmlAttr($block->getFormId())?>">
14-
<label for="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?php /* @escapeNotVerified */ echo __('Please type the letters below')?></span></label>
15+
<label for="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?php echo $block->escapeHtml(__('Please type the letters below')) ?></span></label>
1516
<div class="control captcha">
1617
<input name="<?php echo $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?php echo $block->escapeHtmlAttr($block->getFormId())?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" />
1718
<div class="nested">
@@ -22,13 +23,13 @@
2223
"imageLoader": "<?php echo $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>",
2324
"type": "<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>"}}'>
2425
<div class="control captcha-image">
25-
<img alt="<?php /* @escapeNotVerified */ echo __('Please type the letters below')?>" class="captcha-img" height="<?php /* @noEscape */ echo (float) $block->getImgHeight() ?>" src="<?php echo $block->escapeUrl($captcha->getImgSrc()) ?>"/>
26-
<button type="button" class="action reload captcha-reload" title="<?php /* @escapeNotVerified */ echo __('Reload captcha') ?>"><span><?php /* @escapeNotVerified */ echo __('Reload captcha') ?></span></button>
26+
<img alt="<?php echo $block->escapeHtmlAttr(__('Please type the letters below')) ?>" class="captcha-img" height="<?php /* @noEscape */ echo (float) $block->getImgHeight() ?>" src="<?php echo $block->escapeUrl($captcha->getImgSrc()) ?>"/>
27+
<button type="button" class="action reload captcha-reload" title="<?php echo $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?php echo $block->escapeHtml(__('Reload captcha')) ?></span></button>
2728
</div>
2829
</div>
2930
<?php if ($captcha->isCaseSensitive()) :?>
3031
<div class="captcha-note note">
31-
<?php /* @escapeNotVerified */ echo __('<strong>Attention</strong>: Captcha is case sensitive.') ?>
32+
<?php echo $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) ?>
3233
</div>
3334
<?php endif; ?>
3435
</div>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public function update($sku, ProductAttributeMediaGalleryEntryInterface $entry)
9696
foreach ($existingMediaGalleryEntries as $key => $existingEntry) {
9797
if ($existingEntry->getId() == $entry->getId()) {
9898
$found = true;
99+
if ($entry->getFile()) {
100+
$entry->setId(null);
101+
}
99102
$existingMediaGalleryEntries[$key] = $entry;
100103
break;
101104
}

app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/GalleryManagementTest.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function setUp()
4545
{
4646
$this->productRepositoryMock = $this->getMock(\Magento\Catalog\Api\ProductRepositoryInterface::class);
4747
$this->contentValidatorMock = $this->getMock(\Magento\Framework\Api\ImageContentValidatorInterface::class);
48-
$this->productMock = $this->getMock(
48+
$this->productMock = $this->getMock(
4949
\Magento\Catalog\Model\Product::class,
5050
[
5151
'setStoreId',
@@ -115,7 +115,7 @@ public function testCreateWithCannotSaveException()
115115
public function testCreate()
116116
{
117117
$productSku = 'mediaProduct';
118-
$entryContentMock = $this->getMock(
118+
$entryContentMock = $this->getMock(
119119
\Magento\Framework\Api\Data\ImageContentInterface::class
120120
);
121121
$this->mediaGalleryEntryMock->expects($this->any())->method('getContent')->willReturn($entryContentMock);
@@ -153,8 +153,8 @@ public function testUpdateWithNonExistingImage()
153153
$entryId = 42;
154154
$this->productRepositoryMock->expects($this->once())->method('get')->with($productSku)
155155
->willReturn($this->productMock);
156-
$existingEntryMock = $this->getMock(
157-
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
156+
$existingEntryMock = $this->getMock(
157+
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
158158
);
159159
$existingEntryMock->expects($this->once())->method('getId')->willReturn(43);
160160
$this->productMock->expects($this->once())->method('getMediaGalleryEntries')
@@ -174,8 +174,8 @@ public function testUpdateWithCannotSaveException()
174174
$entryId = 42;
175175
$this->productRepositoryMock->expects($this->once())->method('get')->with($productSku)
176176
->willReturn($this->productMock);
177-
$existingEntryMock = $this->getMock(
178-
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
177+
$existingEntryMock = $this->getMock(
178+
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
179179
);
180180
$existingEntryMock->expects($this->once())->method('getId')->willReturn($entryId);
181181
$this->productMock->expects($this->once())->method('getMediaGalleryEntries')
@@ -193,13 +193,15 @@ public function testUpdate()
193193
$entryId = 42;
194194
$this->productRepositoryMock->expects($this->once())->method('get')->with($productSku)
195195
->willReturn($this->productMock);
196-
$existingEntryMock = $this->getMock(
197-
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
196+
$existingEntryMock = $this->getMock(
197+
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
198198
);
199199
$existingEntryMock->expects($this->once())->method('getId')->willReturn($entryId);
200200
$this->productMock->expects($this->once())->method('getMediaGalleryEntries')
201201
->willReturn([$existingEntryMock]);
202202
$entryMock->expects($this->once())->method('getId')->willReturn($entryId);
203+
$entryMock->expects($this->once())->method('getFile')->willReturn("base64");
204+
$entryMock->expects($this->once())->method('setId')->with(null);
203205

204206
$this->productMock->expects($this->once())->method('setMediaGalleryEntries')
205207
->willReturn([$entryMock]);
@@ -217,8 +219,8 @@ public function testRemoveWithNonExistingImage()
217219
$entryId = 42;
218220
$this->productRepositoryMock->expects($this->once())->method('get')->with($productSku)
219221
->willReturn($this->productMock);
220-
$existingEntryMock = $this->getMock(
221-
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
222+
$existingEntryMock = $this->getMock(
223+
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
222224
);
223225
$existingEntryMock->expects($this->once())->method('getId')->willReturn(43);
224226
$this->productMock->expects($this->once())->method('getMediaGalleryEntries')
@@ -232,8 +234,8 @@ public function testRemove()
232234
$entryId = 42;
233235
$this->productRepositoryMock->expects($this->once())->method('get')->with($productSku)
234236
->willReturn($this->productMock);
235-
$existingEntryMock = $this->getMock(
236-
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
237+
$existingEntryMock = $this->getMock(
238+
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
237239
);
238240
$existingEntryMock->expects($this->once())->method('getId')->willReturn(42);
239241
$this->productMock->expects($this->once())->method('getMediaGalleryEntries')
@@ -267,8 +269,8 @@ public function testGetWithNonExistingImage()
267269
$imageId = 43;
268270
$this->productRepositoryMock->expects($this->once())->method('get')->with($productSku)
269271
->willReturn($this->productMock);
270-
$existingEntryMock = $this->getMock(
271-
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
272+
$existingEntryMock = $this->getMock(
273+
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
272274
);
273275
$existingEntryMock->expects($this->once())->method('getId')->willReturn(44);
274276
$this->productMock->expects($this->once())->method('getMediaGalleryEntries')
@@ -282,8 +284,8 @@ public function testGet()
282284
$imageId = 42;
283285
$this->productRepositoryMock->expects($this->once())->method('get')->with($productSku)
284286
->willReturn($this->productMock);
285-
$existingEntryMock = $this->getMock(
286-
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
287+
$existingEntryMock = $this->getMock(
288+
\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
287289
);
288290
$existingEntryMock->expects($this->once())->method('getId')->willReturn(42);
289291
$this->productMock->expects($this->once())->method('getMediaGalleryEntries')

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ private function getTierPriceStructure($tierPricePath)
415415
'enabled' => false,
416416
],
417417
'disabled' => false,
418+
'required' => false,
418419
'sortOrder' =>
419420
$this->arrayManager->get($tierPricePath . '/arguments/data/config/sortOrder', $this->meta),
420421
],

app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/attributes_values.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
); ?></h2>
1515
<div class="steps-wizard-info">
1616
<span><?php echo $block->escapeHtml(
17-
__('Select values from each attribute to include in this product. Each unique combination of values creates a unigue product SKU.')
17+
__('Select values from each attribute to include in this product. Each unique combination of values creates a unique product SKU.')
1818
);?></span>
1919
</div>
2020
<div data-bind="foreach: attributes, sortableList: attributes">

0 commit comments

Comments
 (0)