Skip to content

Commit 70e8f0d

Browse files
🔃 [EngCom] Public Pull Requests - 2.1-develop
Accepted Public Pull Requests: - #14922: [Backport] Customer observer name typo fix (by @rogyar) - #14903: [Backport] Pass parameter for export button url (by @rogyar) Fixed GitHub Issues: - #12714: Extra records are in exported CSV file for order (reported by @alena-marchenko) has been fixed in #14903 by @rogyar in 2.1-develop branch Related commits: 1. 4bb9d27 2. 67268ca 3. 9c5517a
2 parents fe12897 + 2810b5b commit 70e8f0d

File tree

5 files changed

+52
-5
lines changed

5 files changed

+52
-5
lines changed

app/code/Magento/Customer/etc/events.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<observer name="customer_address_before_save_viv_observer" instance="Magento\Customer\Observer\BeforeAddressSaveObserver" />
1111
</event>
1212
<event name="customer_address_save_after">
13-
<observer name="customer_addres_after_save_viv_observer" instance="Magento\Customer\Observer\AfterAddressSaveObserver" />
13+
<observer name="customer_address_after_save_viv_observer" instance="Magento\Customer\Observer\AfterAddressSaveObserver" />
1414
</event>
1515
<event name="sales_quote_save_after">
1616
<observer name="customer_visitor" instance="Magento\Customer\Observer\Visitor\BindQuoteCreateObserver" />

app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@
3434
<listingToolbar name="listing_top">
3535
<bookmark name="bookmarks"/>
3636
<columnsControls name="columns_controls"/>
37-
<exportButton name="export_button"/>
37+
<exportButton name="export_button">
38+
<argument name="data" xsi:type="array">
39+
<item name="config" xsi:type="array">
40+
<item name="additionalParams" xsi:type="array">
41+
<item xsi:type="string" name="order_id">*</item>
42+
</item>
43+
</item>
44+
</argument>
45+
</exportButton>
3846
<filterSearch name="fulltext"/>
3947
<filters name="listing_filters">
4048
<filterSelect name="store_id">

app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@
3434
<listingToolbar name="listing_top">
3535
<bookmark name="bookmarks"/>
3636
<columnsControls name="columns_controls"/>
37-
<exportButton name="export_button"/>
37+
<exportButton name="export_button">
38+
<argument name="data" xsi:type="array">
39+
<item name="config" xsi:type="array">
40+
<item name="additionalParams" xsi:type="array">
41+
<item xsi:type="string" name="order_id">*</item>
42+
</item>
43+
</item>
44+
</argument>
45+
</exportButton>
3846
<filterSearch name="fulltext"/>
3947
<filters name="listing_filters">
4048
<filterSelect name="store_id">

app/code/Magento/Sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@
3434
<listingToolbar name="listing_top">
3535
<bookmark name="bookmarks"/>
3636
<columnsControls name="columns_controls"/>
37-
<exportButton name="export_button"/>
37+
<exportButton name="export_button">
38+
<argument name="data" xsi:type="array">
39+
<item name="config" xsi:type="array">
40+
<item name="additionalParams" xsi:type="array">
41+
<item xsi:type="string" name="order_id">*</item>
42+
</item>
43+
</item>
44+
</argument>
45+
</exportButton>
3846
<filterSearch name="fulltext"/>
3947
<filters name="listing_filters">
4048
<filterSelect name="store_id">

app/code/Magento/Ui/Component/ExportButton.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,39 @@ public function getComponentName()
5454
*/
5555
public function prepare()
5656
{
57+
$context = $this->getContext();
5758
$config = $this->getData('config');
5859
if (isset($config['options'])) {
5960
$options = [];
6061
foreach ($config['options'] as $option) {
61-
$option['url'] = $this->urlBuilder->getUrl($option['url']);
62+
$additionalParams = $this->getAdditionalParams($config, $context);
63+
$option['url'] = $this->urlBuilder->getUrl($option['url'], $additionalParams);
6264
$options[] = $option;
6365
}
6466
$config['options'] = $options;
6567
$this->setData('config', $config);
6668
}
6769
parent::prepare();
6870
}
71+
72+
/**
73+
* Get export button additional parameters
74+
*
75+
* @param array $config
76+
* @param ContextInterface $context
77+
* @return array
78+
*/
79+
private function getAdditionalParams($config, $context)
80+
{
81+
$additionalParams = [];
82+
if (isset($config['additionalParams'])) {
83+
foreach ($config['additionalParams'] as $paramName => $paramValue) {
84+
if ('*' == $paramValue) {
85+
$paramValue = $context->getRequestParam($paramName);
86+
}
87+
$additionalParams[$paramName] = $paramValue;
88+
}
89+
}
90+
return $additionalParams;
91+
}
6992
}

0 commit comments

Comments
 (0)