Closed
Description
Steps to reproduce
- Install Magento 2.1.0.
- Place some orders, and generate some invoices
- Verify that the invoices have been generated in Admin > Sales > Operations > Invoices:
- Try to batch-print these invoices in Sales > Orders:
Expected result
- Invoice Collection rendered as PDF
Actual result
Problem
- The $collection argument passed to Magento\Sales\Controller\Adminhtml\Order\Pdfinvoices::massAction() is an instance of Magento\Sales\Model\ResourceModel\Order\Invoice\Collection.
- The line
$invoicesCollection = $this->collectionFactory->create()->setOrderFilter(['in' => $collection->getAllIds()]);
filters $invoicesCollection with setOrderFilter() using a an array of invoice IDs, not order IDs - Apparently it should be
$invoicesCollection = $this->collectionFactory->create()->addAttributeToFilter('entity_id', ['in' => $collection->getAllIds()]);
.