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

Commit 9df49a6

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento-engcom/magento2ce#1362: [EngCom Team] Batch 34. Forwardports to 2.3-develop (by @magento-engcom-team) - magento-engcom/magento2ce#1361: [EngCom Team] Batch 33. Forwardports to 2.3-develop (by @magento-engcom-team) - magento-engcom/magento2ce#1342: [EngCom Team] Batch 27. Forwardports to 2.3-develop (by @magento-engcom-team) - magento-engcom/magento2ce#1359: [EngCom Team] Batch 32. Forwardports to 2.3-develop (by @magento-engcom-team) Fixed GitHub Issues: - magento/magento2#5035: I can not to subscribe on change of all sections in Stores ->Configuration using event admin_system_config_changed_section (reported by @katesuykovskaya) has been fixed in magento-engcom/magento2ce#1362 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 4705e23 2. 6d355e0 3. 77f34cf 4. 748ab4d 5. 90f9d95 6. 44ca24f 7. f0b7f2b 8. c3e1d93 9. 4810755 10. 4709a22 11. a2b9fab 12. ac7df33 13. 245238d 14. 2c153c3 15. 48a72fa 16. 625f685 17. afa4516 - magento/magento2#9055: Default Store is always used when retrieving sequence value's for sales entity's. (reported by @reztierk) has been fixed in magento-engcom/magento2ce#1362 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 4705e23 2. 6d355e0 3. 77f34cf 4. 748ab4d 5. 90f9d95 6. 44ca24f 7. f0b7f2b 8. c3e1d93 9. 4810755 10. 4709a22 11. a2b9fab 12. ac7df33 13. 245238d 14. 2c153c3 15. 48a72fa 16. 625f685 17. afa4516 - magento/magento2#10438: Potential error on order edit page when address has extension attributes (reported by @dankocherga) has been fixed in magento-engcom/magento2ce#1362 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 4705e23 2. 6d355e0 3. 77f34cf 4. 748ab4d 5. 90f9d95 6. 44ca24f 7. f0b7f2b 8. c3e1d93 9. 4810755 10. 4709a22 11. a2b9fab 12. ac7df33 13. 245238d 14. 2c153c3 15. 48a72fa 16. 625f685 17. afa4516 - magento/magento2#12699: Multiselect Attribute is not saved for a product in the admin panel when it has a related product using another attribute set (reported by @bmisyura) has been fixed in magento-engcom/magento2ce#1362 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 4705e23 2. 6d355e0 3. 77f34cf 4. 748ab4d 5. 90f9d95 6. 44ca24f 7. f0b7f2b 8. c3e1d93 9. 4810755 10. 4709a22 11. a2b9fab 12. ac7df33 13. 245238d 14. 2c153c3 15. 48a72fa 16. 625f685 17. afa4516 - magento/magento2#9036: Database backup doesn't include triggers (reported by @domeglic) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#9918: Magento 2 automatically disables maintenance mode after certain actions (reported by @royvanos) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#10697: Product Import: Additional data: Invalid URL key (reported by @Alex-James17) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#11332: How to Fix the wrong input format of Customer date of birth (reported by @selusi) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#11796: Magento2.2.0 home page product grid issues (reported by @losetemp) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#12064: Database Rollback not working with magento 2.1.9? (reported by @whereowareadmin) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#12127: Apostrophe in attribute option value in admin is not handled properly (reported by @erfanimani) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#12446: Remove /home from the sitemap.xml (reported by @wd7080) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#12714: Extra records are in exported CSV file for order (reported by @alena-marchenko) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - magento/magento2#12828: Uncaught Error: Script error for: trackingCode error on every frontend page (reported by @poojawebkul) has been fixed in magento-engcom/magento2ce#1342 by @magento-engcom-team in 2.3-develop branch Related commits: 1. aa93f83 2. 0b76fcd 3. be77fdd 4. 4bad8be 5. 59e1020 6. ef63b3a 7. a278aaf 8. f7c00d7 9. f1ecb11 10. 74aabb4 11. 1d66e5e 12. dc4977d 13. 99f982c 14. 76c4f0d 15. 9e2cc5e 16. 82d488b - magento/magento2#5774: Tier price and custom options give bad results (reported by @yangsystem) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - magento/magento2#6916: Update Bundle Product without changes in bundle items (reported by @magecodenet) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - magento/magento2#9277: Create new CLI command: enable/disable Magento Profiler (reported by @vrann) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - magento/magento2#10133: Please add your expectations for @deprecated annotations (reported by @flancer64) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - magento/magento2#11792: Can't add customizable options to product (reported by @mikelevy300) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - magento/magento2#12374: Model hasDataChanges always true (reported by @Detzler) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - magento/magento2#12430: While assigning prices to configurable products, prices aren's readable when using custom price symbol. (reported by @quisse) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - magento/magento2#12705: Integrity constraint violation error after reordering product with custom options (reported by @alena-marchenko) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5
2 parents ec39184 + b06928d commit 9df49a6

File tree

98 files changed

+2817
-969
lines changed

Some content is hidden

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

98 files changed

+2817
-969
lines changed

COPYING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2013-2017 Magento, Inc.
1+
Copyright © 2013-2018 Magento, Inc.
22

33
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license
44

app/bootstrap.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@
4949
unset($_SERVER['ORIG_PATH_INFO']);
5050
}
5151

52-
if (!empty($_SERVER['MAGE_PROFILER'])
52+
if (
53+
(!empty($_SERVER['MAGE_PROFILER']) || file_exists(BP . '/var/profiler.flag'))
5354
&& isset($_SERVER['HTTP_ACCEPT'])
5455
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
5556
) {
5657
\Magento\Framework\Profiler::applyConfig(
57-
$_SERVER['MAGE_PROFILER'],
58+
(isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])) ? $_SERVER['MAGE_PROFILER'] : trim(file_get_contents(BP . '/var/profiler.flag')),
5859
BP,
5960
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
6061
);

app/code/Magento/Backup/Model/Db.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu
173173
}
174174
}
175175
$backup->write($this->getResource()->getTableForeignKeysSql());
176+
$backup->write($this->getResource()->getTableTriggersSql());
176177
$backup->write($this->getResource()->getFooter());
177178

178179
$this->getResource()->commitTransaction();

app/code/Magento/Backup/Model/ResourceModel/Db.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,31 @@ public function getTableForeignKeysSql($tableName = null)
114114
return $fkScript;
115115
}
116116

117+
/**
118+
* Return triggers for table(s).
119+
*
120+
* @param string|null $tableName
121+
* @param bool $addDropIfExists
122+
* @return string
123+
*/
124+
public function getTableTriggersSql($tableName = null, $addDropIfExists = true)
125+
{
126+
$triggerScript = '';
127+
if (!$tableName) {
128+
$tables = $this->getTables();
129+
foreach ($tables as $table) {
130+
$tableTriggerScript = $this->_resourceHelper->getTableTriggersSql($table, $addDropIfExists);
131+
if (!empty($tableTriggerScript)) {
132+
$triggerScript .= "\n" . $tableTriggerScript;
133+
}
134+
}
135+
} else {
136+
$triggerScript = $this->getTableTriggersSql($tableName, $addDropIfExists);
137+
}
138+
139+
return $triggerScript;
140+
}
141+
117142
/**
118143
* Retrieve table status
119144
*

app/code/Magento/Backup/Model/ResourceModel/Helper.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,40 @@ public function restoreTransactionIsolationLevel()
337337
{
338338
$this->getConnection()->query('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
339339
}
340+
341+
/**
342+
* Get create script for triggers.
343+
*
344+
* @param string $tableName
345+
* @param boolean $addDropIfExists
346+
* @param boolean $stripDefiner
347+
* @return string
348+
*/
349+
public function getTableTriggersSql($tableName, $addDropIfExists = false, $stripDefiner = true)
350+
{
351+
$script = "--\n-- Triggers structure for table `{$tableName}`\n--\n";
352+
$triggers = $this->getConnection()->query('SHOW TRIGGERS LIKE \''. $tableName . '\'')->fetchAll();
353+
354+
if (!$triggers) {
355+
return '';
356+
}
357+
foreach ($triggers as $trigger) {
358+
if ($addDropIfExists) {
359+
$script .= 'DROP TRIGGER IF EXISTS ' . $trigger['Trigger'] . ";\n";
360+
}
361+
$script .= "delimiter ;;\n";
362+
363+
$triggerData = $this->getConnection()->query('SHOW CREATE TRIGGER '. $trigger['Trigger'])->fetch();
364+
if ($stripDefiner) {
365+
$cleanedScript = preg_replace('/DEFINER=[^\s]*/', '', $triggerData['SQL Original Statement']);
366+
$script .= $cleanedScript . "\n";
367+
} else {
368+
$script .= $triggerData['SQL Original Statement'] . "\n";
369+
}
370+
$script .= ";;\n";
371+
$script .= "delimiter ;\n";
372+
}
373+
374+
return $script;
375+
}
340376
}

app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected function processBundleOptionsData(\Magento\Catalog\Model\Product $prod
127127
}
128128
$options = [];
129129
foreach ($bundleOptionsData as $key => $optionData) {
130-
if ((bool)$optionData['delete']) {
130+
if (!empty($optionData['delete'])) {
131131
continue;
132132
}
133133

app/code/Magento/Bundle/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/BundleTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ protected function setUp()
5757
'setOptions',
5858
'setCanSaveBundleSelections',
5959
'__wakeup',
60-
'getOptionsReadonly'
60+
'getOptionsReadonly',
61+
'getBundleOptionsData',
62+
'getExtensionAttributes',
63+
'setExtensionAttributes',
6164
];
6265
$this->productMock = $this->createPartialMock(\Magento\Catalog\Model\Product::class, $methods);
6366
$optionInterfaceFactory = $this->getMockBuilder(\Magento\Bundle\Api\Data\OptionInterfaceFactory::class)
@@ -127,6 +130,17 @@ public function testAfterInitializeIfBundleAnsCustomOptionsAndBundleSelectionsEx
127130
);
128131
$this->productMock->expects($this->once())->method('setOptions')->with(null);
129132
$this->productMock->expects($this->once())->method('setCanSaveBundleSelections')->with(true);
133+
$this->productMock->expects($this->once())
134+
->method('getBundleOptionsData')
135+
->willReturn(['option_1' => ['delete' => 1]]);
136+
$extentionAttribute = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductExtensionInterface::class)
137+
->disableOriginalConstructor()
138+
->setMethods(['setBundleProductOptions'])
139+
->getMockForAbstractClass();
140+
$extentionAttribute->expects($this->once())->method('setBundleProductOptions')->with([]);
141+
$this->productMock->expects($this->once())->method('getExtensionAttributes')->willReturn($extentionAttribute);
142+
$this->productMock->expects($this->once())->method('setExtensionAttributes')->with($extentionAttribute);
143+
130144
$this->model->afterInitialize($this->subjectMock, $this->productMock);
131145
}
132146

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Catalog\Model\Product;
1010
use Magento\Catalog\Model\Product\Option;
11+
use Magento\Catalog\Pricing\Price\BasePrice;
1112
use Magento\Framework\Model\AbstractModel;
1213

1314
/**
@@ -222,7 +223,7 @@ public function saveValues()
222223
public function getPrice($flag = false)
223224
{
224225
if ($flag && $this->getPriceType() == self::TYPE_PERCENT) {
225-
$basePrice = $this->getOption()->getProduct()->getFinalPrice();
226+
$basePrice = $this->getOption()->getProduct()->getPriceInfo()->getPrice(BasePrice::PRICE_CODE)->getValue();
226227
$price = $basePrice * ($this->_getData(self::KEY_PRICE) / 100);
227228
return $price;
228229
}

app/code/Magento/Catalog/Test/Unit/Model/Product/Option/ValueTest.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ private function getMockedValueCollectionFactory()
104104

105105
$mockBuilder =
106106
$this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Option\Value\CollectionFactory::class)
107-
->setMethods(['create'])
108-
->disableOriginalConstructor();
107+
->setMethods(['create'])
108+
->disableOriginalConstructor();
109109
$mock = $mockBuilder->getMock();
110110

111111
$mock->expects($this->any())
@@ -164,13 +164,27 @@ private function getMockedOption()
164164
private function getMockedProduct()
165165
{
166166
$mockBuilder = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
167-
->setMethods(['getFinalPrice', '__wakeup'])
167+
->setMethods(['getPriceInfo', '__wakeup'])
168168
->disableOriginalConstructor();
169169
$mock = $mockBuilder->getMock();
170170

171-
$mock->expects($this->any())
172-
->method('getFinalPrice')
173-
->will($this->returnValue(10));
171+
$priceInfoMock = $this->getMockForAbstractClass(
172+
\Magento\Framework\Pricing\PriceInfoInterface::class,
173+
[],
174+
'',
175+
false,
176+
false,
177+
true,
178+
['getPrice']
179+
);
180+
181+
$priceMock = $this->getMockForAbstractClass(\Magento\Framework\Pricing\Price\PriceInterface::class);
182+
183+
$priceInfoMock->expects($this->any())->method('getPrice')->willReturn($priceMock);
184+
185+
$mock->expects($this->any())->method('getPriceInfo')->willReturn($priceInfoMock);
186+
187+
$priceMock->expects($this->any())->method('getValue')->willReturn(10);
174188

175189
return $mock;
176190
}

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/AbstractTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ public function testWalkAttributes()
4444

4545
$code = 'test_attr';
4646
$set = 10;
47+
$storeId = 100;
4748

4849
$object = $this->createPartialMock(\Magento\Catalog\Model\Product::class, ['__wakeup']);
4950

5051
$object->setData('test_attr', 'test_attr');
5152
$object->setData('attribute_set_id', $set);
53+
$object->setData('store_id', $storeId);
5254

5355
$entityType = new \Magento\Framework\DataObject();
5456
$entityType->setEntityTypeCode('test');

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CustomOptionsTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,16 @@ public function testModifyMeta()
154154
->method('getAll')
155155
->willReturn([]);
156156

157-
$this->assertArrayHasKey(CustomOptions::GROUP_CUSTOM_OPTIONS_NAME, $this->getModel()->modifyMeta([]));
157+
$meta = $this->getModel()->modifyMeta([]);
158+
159+
$this->assertArrayHasKey(CustomOptions::GROUP_CUSTOM_OPTIONS_NAME, $meta);
160+
161+
$buttonAdd = $meta['custom_options']['children']['container_header']['children']['button_add'];
162+
$buttonAddTargetName = $buttonAdd['arguments']['data']['config']['actions'][0]['targetName'];
163+
$expectedTargetName = '${ $.ns }.${ $.ns }.' . CustomOptions::GROUP_CUSTOM_OPTIONS_NAME
164+
. '.' . CustomOptions::GRID_OPTIONS_NAME;
165+
166+
$this->assertEquals($expectedTargetName, $buttonAddTargetName);
158167
}
159168

160169
/**

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ protected function getHeaderContainerConfig($sortOrder)
348348
'sortOrder' => 20,
349349
'actions' => [
350350
[
351-
'targetName' => 'ns = ${ $.ns }, index = ' . static::GRID_OPTIONS_NAME,
351+
'targetName' => '${ $.ns }.${ $.ns }.' . static::GROUP_CUSTOM_OPTIONS_NAME
352+
. '.' . static::GRID_OPTIONS_NAME,
352353
'actionName' => 'processingAddChild',
353354
]
354355
]

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ $stores = $block->getStoresSortedBySortOrder();
8888
$values = [];
8989
foreach($block->getOptionValues() as $value) {
9090
$value = $value->getData();
91-
$values[] = is_array($value) ? array_map("htmlspecialchars_decode", $value) : $value;
91+
$values[] = is_array($value) ? array_map(function($str) {
92+
return htmlspecialchars_decode($str, ENT_QUOTES);
93+
}, $value) : $value;
9294
}
9395
?>
9496
<script type="text/x-magento-init">

app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ switch ($type = $block->getType()) {
146146
}
147147
break;
148148

149-
case 'other':
150-
break;
149+
default:
150+
$exist = null;
151151
}
152152
?>
153153

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use Magento\CatalogImportExport\Model\Import\Product\ImageTypeProcessor;
1212
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
1313
use Magento\Framework\App\Filesystem\DirectoryList;
14+
use Magento\Framework\App\ObjectManager;
15+
use Magento\Framework\Exception\LocalizedException;
1416
use Magento\Framework\Filesystem;
1517
use Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor;
1618
use Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface;
@@ -20,7 +22,6 @@
2022
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError;
2123
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
2224
use Magento\Store\Model\Store;
23-
use Magento\Framework\App\ObjectManager;
2425

2526
/**
2627
* Import entity product model
@@ -729,7 +730,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
729730
* @param \Magento\CatalogInventory\Model\Spi\StockStateProviderInterface $stockStateProvider
730731
* @param \Magento\Catalog\Helper\Data $catalogData
731732
* @param \Magento\ImportExport\Model\Import\Config $importConfig
732-
* @param Proxy\Product\ResourceFactory $resourceFactory
733+
* @param Proxy\Product\ResourceModelFactory $resourceFactory
733734
* @param Product\OptionFactory $optionFactory
734735
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $setColFactory
735736
* @param Product\Type\Factory $productTypeFactory
@@ -1121,12 +1122,12 @@ protected function _initTypeModels()
11211122
$params = [$this, $productTypeName];
11221123
if (!($model = $this->_productTypeFactory->create($productTypeConfig['model'], ['params' => $params]))
11231124
) {
1124-
throw new \Magento\Framework\Exception\LocalizedException(
1125+
throw new LocalizedException(
11251126
__('Entity type model \'%1\' is not found', $productTypeConfig['model'])
11261127
);
11271128
}
11281129
if (!$model instanceof \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType) {
1129-
throw new \Magento\Framework\Exception\LocalizedException(
1130+
throw new LocalizedException(
11301131
__(
11311132
'Entity type model must be an instance of '
11321133
. \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType::class
@@ -1549,6 +1550,7 @@ public function getImagesFromRow(array $rowData)
15491550
* @SuppressWarnings(PHPMD.NPathComplexity)
15501551
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
15511552
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
1553+
* @throws LocalizedException
15521554
*/
15531555
protected function _saveProducts()
15541556
{
@@ -1609,7 +1611,7 @@ protected function _saveProducts()
16091611

16101612
// wrong attribute_set_code was received
16111613
if (!$attributeSetId) {
1612-
throw new \Magento\Framework\Exception\LocalizedException(
1614+
throw new LocalizedException(
16131615
__(
16141616
'Wrong attribute set code "%1", please correct it and try again.',
16151617
$rowData['attribute_set_code']
@@ -1822,7 +1824,7 @@ protected function _saveProducts()
18221824
) {
18231825
$attrValue = $this->dateTime->formatDate($attrValue, false);
18241826
} elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {
1825-
$attrValue = $this->dateTime->gmDate(
1827+
$attrValue = gmdate(
18261828
'Y-m-d H:i:s',
18271829
$this->_localeDate->date($attrValue)->getTimestamp()
18281830
);
@@ -2004,7 +2006,7 @@ protected function _getUploader()
20042006
}
20052007

20062008
if (!$this->_fileUploader->setTmpDir($tmpPath)) {
2007-
throw new \Magento\Framework\Exception\LocalizedException(
2009+
throw new LocalizedException(
20082010
__('File directory \'%1\' is not readable.', $tmpPath)
20092011
);
20102012
}
@@ -2013,7 +2015,7 @@ protected function _getUploader()
20132015

20142016
$this->_mediaDirectory->create($destinationPath);
20152017
if (!$this->_fileUploader->setDestDir($destinationPath)) {
2016-
throw new \Magento\Framework\Exception\LocalizedException(
2018+
throw new LocalizedException(
20172019
__('File directory \'%1\' is not writable.', $destinationPath)
20182020
);
20192021
}
@@ -2035,6 +2037,8 @@ public function getUploader()
20352037
* Return a new file name if the same file is already exists.
20362038
*
20372039
* @param string $fileName
2040+
* @param bool $renameFileOff [optional] boolean to pass.
2041+
* Default is false which will set not to rename the file after import.
20382042
* @return string
20392043
*/
20402044
protected function uploadMediaFiles($fileName, $renameFileOff = false)
@@ -2162,7 +2166,7 @@ protected function _saveStockItem()
21622166
$stockItemDo->setData($row);
21632167
$row['is_in_stock'] = $this->stockStateProvider->verifyStock($stockItemDo);
21642168
if ($this->stockStateProvider->verifyNotification($stockItemDo)) {
2165-
$row['low_stock_date'] = $this->dateTime->gmDate(
2169+
$row['low_stock_date'] = gmdate(
21662170
'Y-m-d H:i:s',
21672171
(new \DateTime())->getTimestamp()
21682172
);
@@ -2678,7 +2682,7 @@ private function _customFieldsMapping($rowData)
26782682
/**
26792683
* Validate data rows and save bunches to DB
26802684
*
2681-
* @return $this
2685+
* @return $this|AbstractEntity
26822686
*/
26832687
protected function _saveValidatedBunches()
26842688
{

app/code/Magento/CatalogImportExport/Model/Import/Product/CategoryProcessor.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ protected function createCategory($name, $parentId)
119119
$category->setIsActive(true);
120120
$category->setIncludeInMenu(true);
121121
$category->setAttributeSetId($category->getDefaultAttributeSetId());
122-
$category->save();
123-
$this->categoriesCache[$category->getId()] = $category;
122+
try {
123+
$category->save();
124+
$this->categoriesCache[$category->getId()] = $category;
125+
} catch (\Exception $e) {
126+
$this->addFailedCategory($category, $e);
127+
}
124128

125129
return $category->getId();
126130
}

0 commit comments

Comments
 (0)