-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [EngCom] Public Pull Requests - 2.3-develop Minor Fixes
Accepted Public Pull Requests: - #22421: Spelling correction (by @ansari-krish) - #22420: Correct spelling (by @ravi-chandra3197) - #19993: fixed issue of Backup tool not correctly detecting .maintenance.flag (by @hiren0241) - #22382: Don't skip row on import if image not available. (by @Nazar65) - #22263: Prevented /Magento/Sales/Model/Service/InvoiceService.php incorrectly� (by @ryanpalmerweb) - #22233: [Fixed] Full Tax Summary missing calculation Admin create order (by @niravkrish) - #21711: Purchasing a downloadable product as guest then creating an account on the onepagesuccess step doesn't link product with account (by @Jitheesh) - #20174: Fix issues inserting Widgets with nested WYSIWYGs (by @molovo) - #21816: #21779 Adminhtml textarea field doesn't accept maxlength (by @kisroman) - #21756: Fixes race condition when building merged css/js file during simultaneous requests (by @Ian410) - #21670: Fix getSize method after clearing data collection (by @sergeynezbritskiy) Fixed GitHub Issues: - #19825: Magento 2.3.0: Backup tool not correctly detecting .maintenance.flag (reported by @nexrobr) has been fixed in #19993 by @hiren0241 in 2.3-develop branch Related commits: 1. fd92027 2. 6374f9d 3. 658b5a7 4. 5bc05b2 - #22355: Import product quantity is empty after import (reported by @kevinvuillemin) has been fixed in #22382 by @Nazar65 in 2.3-develop branch Related commits: 1. e949e85 2. bfc82b6 3. b6784b5 - #22246: Programatically created invoices miss items when both simple products and bundled products are mixed in an order (reported by @ryanpalmerweb) has been fixed in #22263 by @ryanpalmerweb in 2.3-develop branch Related commits: 1. ec2c6ca - #21702: Purchasing a downloadable product as guest then creating an account on the onepagesuccess step doesn't link product with account (reported by @crankycyclops) has been fixed in #21711 by @Jitheesh in 2.3-develop branch Related commits: 1. fc1434b 2. 8652bc8 3. 95b1d53 4. 0ade930 - #13409: custom widget with wysiwyg problem on insert widget via pages or blocks (reported by @deagleka) has been fixed in #20174 by @molovo in 2.3-develop branch Related commits: 1. 3bcf0d8 2. d4e0c28 - #19742: Widgets with a WYSIWYG parameter fail when inserting them into a WYSIWYG in a form. (reported by @molovo) has been fixed in #20174 by @molovo in 2.3-develop branch Related commits: 1. 3bcf0d8 2. d4e0c28 - #21779: Adminhtml textarea field doesn't accept maxlength (reported by @rafaelstz) has been fixed in #21816 by @kisroman in 2.3-develop branch Related commits: 1. 1dc63e8 2. 4a0fb16 3. 149294b - #21654: \Magento\Framework\Data\Collection::clear does not clear the result for \Magento\Framework\Data\Collection::getSize (reported by @sergeynezbritskiy) has been fixed in #21670 by @sergeynezbritskiy in 2.3-develop branch Related commits: 1. 2038d7d 2. 71effbe 3. eea6126
- Loading branch information
Showing
20 changed files
with
272 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
app/code/Magento/Downloadable/Observer/UpdateLinkPurchasedObserver.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Downloadable\Observer; | ||
|
||
use Magento\Framework\Event\ObserverInterface; | ||
|
||
/** | ||
* Assign Downloadable links to customer created after issuing guest order. | ||
*/ | ||
class UpdateLinkPurchasedObserver implements ObserverInterface | ||
{ | ||
/** | ||
* Core store config | ||
* @var \Magento\Framework\App\Config\ScopeConfigInterface | ||
*/ | ||
private $scopeConfig; | ||
|
||
/** | ||
* @var \Magento\Downloadable\Model\ResourceModel\Link\Purchased\CollectionFactory | ||
*/ | ||
private $purchasedFactory; | ||
|
||
/** | ||
* @var \Magento\Framework\DataObject\Copy | ||
*/ | ||
private $objectCopyService; | ||
|
||
/** | ||
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig | ||
* @param \Magento\Downloadable\Model\ResourceModel\Link\Purchased\CollectionFactory $purchasedFactory | ||
* @param \Magento\Framework\DataObject\Copy $objectCopyService | ||
*/ | ||
public function __construct( | ||
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, | ||
\Magento\Downloadable\Model\ResourceModel\Link\Purchased\CollectionFactory $purchasedFactory, | ||
\Magento\Framework\DataObject\Copy $objectCopyService | ||
) { | ||
$this->scopeConfig = $scopeConfig; | ||
$this->purchasedFactory = $purchasedFactory; | ||
$this->objectCopyService = $objectCopyService; | ||
} | ||
|
||
/** | ||
* Re-save order data after order update. | ||
* | ||
* @param \Magento\Framework\Event\Observer $observer | ||
* @return $this | ||
*/ | ||
public function execute(\Magento\Framework\Event\Observer $observer) | ||
{ | ||
$order = $observer->getEvent()->getOrder(); | ||
|
||
if (!$order->getId()) { | ||
//order not saved in the database | ||
return $this; | ||
} | ||
|
||
$purchasedLinks = $this->purchasedFactory->create()->addFieldToFilter( | ||
'order_id', | ||
['eq' => $order->getId()] | ||
); | ||
|
||
foreach ($purchasedLinks as $linkPurchased) { | ||
$this->objectCopyService->copyFieldsetToTarget( | ||
\downloadable_sales_copy_order::class, | ||
'to_downloadable', | ||
$order, | ||
$linkPurchased | ||
); | ||
$linkPurchased->save(); | ||
} | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.