Skip to content

Commit 23d12c9

Browse files
committed
MAGETWO-42062: Mass action applied only to first page of grid if select all entities
1 parent a5fa3af commit 23d12c9

File tree

5 files changed

+38
-7
lines changed

5 files changed

+38
-7
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Sales\Ui\Component\Control;
7+
8+
use Magento\Ui\Component\Control\Action;
9+
10+
/**
11+
* Class PdfAction
12+
*/
13+
class PdfAction extends Action
14+
{
15+
/**
16+
* Prepare
17+
*
18+
* @return void
19+
*/
20+
public function prepare()
21+
{
22+
$config = $this->getConfiguration();
23+
$context = $this->getContext();
24+
$config['url'] = $context->getUrl(
25+
$config['pdfAction'],
26+
['order_id' => $context->getRequestParam('order_id')]
27+
);
28+
$this->setData('config', (array)$config);
29+
parent::prepare();
30+
}
31+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
</filterSelect>
5555
</filters>
5656
<massaction name="listing_massaction">
57-
<action name="pdfcreditmemos_order">
57+
<action name="pdfcreditmemos_order" class="Magento\Sales\Ui\Component\Control\PdfAction">
5858
<argument name="data" xsi:type="array">
5959
<item name="config" xsi:type="array">
6060
<item name="type" xsi:type="string">pdfcreditmemos_order</item>
6161
<item name="label" xsi:type="string" translate="true">PDF Creditmemos</item>
62-
<item name="url" xsi:type="url" path="sales/creditmemo/pdfcreditmemos"/>
62+
<item name="pdfAction" xsi:type="string">sales/creditmemo/pdfcreditmemos</item>
6363
</item>
6464
</argument>
6565
</action>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
</filterSelect>
5555
</filters>
5656
<massaction name="listing_massaction">
57-
<action name="pdfinvoices_order">
57+
<action name="pdfinvoices_order" class="Magento\Sales\Ui\Component\Control\PdfAction">
5858
<argument name="data" xsi:type="array">
5959
<item name="config" xsi:type="array">
6060
<item name="type" xsi:type="string">pdfinvoices_order</item>
6161
<item name="label" xsi:type="string" translate="true">PDF Invoices</item>
62-
<item name="url" xsi:type="url" path="sales/invoice/pdfinvoices"/>
62+
<item name="pdfAction" xsi:type="string">sales/invoice/pdfinvoices</item>
6363
</item>
6464
</argument>
6565
</action>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
</filterSelect>
5555
</filters>
5656
<massaction name="listing_massaction">
57-
<action name="pdfshipments_order">
57+
<action name="pdfshipments_order" class="Magento\Sales\Ui\Component\Control\PdfAction">
5858
<argument name="data" xsi:type="array">
5959
<item name="config" xsi:type="array">
6060
<item name="type" xsi:type="string">pdfshipments_order</item>
6161
<item name="label" xsi:type="string" translate="true">PDF Shipments</item>
62-
<item name="url" xsi:type="url" path="sales/shipment/pdfshipments"/>
62+
<item name="pdfAction" xsi:type="string">sales/shipment/pdfshipments</item>
6363
</item>
6464
</argument>
6565
</action>

app/code/Magento/Ui/view/base/web/js/grid/massactions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ define([
147147
* @param {Object} data - Selections data.
148148
*/
149149
defaultCallback: function (action, data) {
150-
var itemsType = data.excludeMode && data.excluded.length !== 0 ? 'excluded' : 'selected',
150+
var itemsType = data.excludeMode ? 'excluded' : 'selected',
151151
selections = {};
152152

153153
selections[itemsType] = data[itemsType];

0 commit comments

Comments
 (0)