I have added a new mass action on the sales order grid. It worked flawlessly on all 1.9.x releases up to 1.9.2.4 upgrade from 1.9.2.2 so I suspect this is now broken by the new security features that require me to white list Variables and Blocks.
The following code adds and enables the mass action (order export to SCV).
/app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php ..
$this->getMassactionBlock()->addItem('export_selected', array(
'label'=> Mage::helper('sales')->__('(new) Export to CSV'),
'url' =>$this->getUrl('*/*/massExport', array('_current'=>true)),
));
..
/app/code/local/Mage/Adminhtml/controllers/Sales/OrderController.php ..
public function massExportAction()
{
//$productIds = $this->getRequest()->getParam('product');
$orderIds = $this->getRequest()->getParam('order_ids');
if (!is_array($orderIds)) {
$this->_getSession()->addError($this->__('Please select orders(s).'));
$this->_redirect('*/*/index');
}
else {
//write headers to the csv file
$content = '"order_number","customer_name","customer_email"';
try {
foreach ($orderIds as $orderId) {
$order = Mage::getSingleton('sales/order')->load($orderId);
$content .= "\"{$order->getIncrementId()}\",\"{$order->getCustomerName()}\",\"{$order->getCustomerEmail()}\"\r\n";
}
} catch (Exception $e) {
$this->_getSession()->addError($e->getMessage());
$this->_redirect('*/*/');
}
$this->_prepareDownloadResponse('orders-export-'.date('Y-m-d H:i:s').'.csv', $content, 'text/csv');
}
}
..
As of 1.9.2.4 calling the function from the Sales Order Grid in the admin interface results in no file being created and 404 that points to frontend..
Any recommendations on what am I missing here?