juanimela Posted January 15, 2015 Share Posted January 15, 2015 In one prestashop install (but not in a different one), I couldn't export orders to csv. I tracked the issue up to a problem in classes/controller/AdminController.php public function processExport($text_delimiter = '"') {... if (isset($params['callback'])) { $callback_obj = (isset($params['callback_object'])) ? $params['callback_object'] : $this->context->controller; $field_value = call_user_func_array(array($callback_obj, $params['callback']), array($field_value, $row)); } The error came because $params['callback_object'] is not set, and $this->context->controller is not a string, and so call_user_func_array fails. I tried $this->context->controller->className instead of $this->context->controller, but in a concrete example, I found that $this->context->controller->className was 'Order' and $params['callback'] was 'setOrderCurrency', and the call to:call_user_func_array(array($callback_obj, $params['callback']), array($field_value, $row));took a valid price and returned an empty string, so I don't see a simple solution that I can propose at github. I don't understand how the whole callback thing works! Regards! Link to comment Share on other sites More sharing options...
zombie process Posted February 10, 2015 Share Posted February 10, 2015 A callback, in the context of a list (orders or customers, for instance), is a function meant to alter the display of a value. It can, for instance, replace the active/inactive value (which is either 1 or 0) by an icon. the pdf callback outputs a pdf icon. Now, the problem, as far as csv export is concerned, is that it will receive, for most callbacks, html instead of a value. Which screws up the export because you'll have html code in your cells. Solution is to ignore, in the processexport method, the callback param, and just output the raw value. Link to comment Share on other sites More sharing options...
ficticius Posted September 20, 2016 Share Posted September 20, 2016 i have the same problem. can u help me find a solution? i just try this fix https://github.com/PrestaShop/PrestaShop/commit/006dcbee13a492d0cad566dc9ea634e100fc8b00 and none! tks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now