Jump to content

csv export broken for orders and customers in 1.6.0.9?


Recommended Posts

Hi, I'm using 1.6.0.9 and I noticed the following problem with the csv export feature:

(note: sensitive info replaced with xxxxx's)

 

1) When exporting customers, extra html and apparently linebreaks are included on the data lines which screws up the csv file

 

e.g.,

 

"516","","xxxxxxx","xxxxxx","[email protected]","","1","<a class="list-action-enable action-enabled" href="index.php?tab=AdminCustomers&id_customer=516&changeNewsletterVal&token=xxxxxxxxxxxxxx">
<i class="icon-check"></i></a>","<a class="list-action-enable action-enabled" href="index.php?tab=AdminCustomers&id_customer=516&changeOptinVal&token=xxxxxxxxxxxxxx">
<i class="icon-check"></i></a>","2014-09-01 19:54:22","2014-09-02 16:03:58",

 

2) When exporting orders, no page is loaded at all. For example, Firefox shows this error:

 

This webpage is not available
Less
The webpage at http://www.yorkshireyarns.com/adminxxxx/index.php?controller=AdminOrders&exportorder&token=xxxxxxxxxxxxxx might be temporarily down or it may have moved permanently to a new web address.
Error code: ERR_INVALID_RESPONSE

 

Edited by buzzworm (see edit history)
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 2 weeks later...

Hi !

Export orders generate a not-found page here too…

I have try to change the AdminController.php, but the line numbers do not match between the fix in the Github and my file, so I don't know if I should try to correct my file all the same or not…

EDIT : I tried to modify my file, and all is OK now, the csv export is working.

Edited by Orphee (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi,

 

I also tried to export the orders in csv, then getting a csv file thats only 128 kb. No information in it.

 

Then tried to update the controller file with the Github fix, but then I can't acces my Admin after this update.

 

Any body know what this is?

 

 

I have btw also a test prestashop where i tried this on, but also on this no acces to admin

Link to comment
Share on other sites

I made the changes from the given link, but it breakes my BO too.. I only get a white empty page in chrome ..

Edit.. |I tried the changes from github again on a fresh Admincontroller.php and now it works! I can now export without problems..

Don't forget to delete the old lines completely....

 

Also for me the line numbers were different than the ones on Github, but is working nevertheless.. 

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

the changes related to the problem of export are very subtile

 

- {

 

- $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));    

 

- }    

 

+ {

 

    + $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));    

 

+ }

 

aren't they ?

 

You can try 

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));    

 

+ if (!preg_match('/<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)/ism', call_user_func_array(array($callback_obj, $params['callback']), array($field_value, $row))))

 

+ $field_value = call_user_func_array(array($callback_obj, $params['callback']), array($field_value, $row));     }     $content[$i][] = $field_value;     }

 

It didn't work for me, but It looks a more appropriate step to investigate..

 

I wish the other bugs of Prestashop let me enough time to brush up my Regex .. and solve it by myself ...

 

In the meantime, I don't find it "normal" ... 

 

Prestashop is free OK, I deserve what I pay for ...maybe  but It generates plenty of  money ... for the time being ..

 

edit: the not so magic link ..

[-] BO : Fix PSCSX-3195 detect if callback return html 1.6.0.11

https://github.com/PrestaShop/PrestaShop/commit/9501318143b2

Edited by misspython (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...
  • 1 month later...

I tried both suggestions on this page, but also got the broken admin like others.  Then I found this solution and it worked: https://www.prestashop.com/forums/topic/146645-module-page-not-loading-increase-your-memory-limit-value-on-your-server-configuration/

 

Never mind.  While it did allow me to export the orders, the file just contained this:

 

<span class="btn-group-action"> <span class="btn-group"> <a class="btn btn-default" target="_blank" href="<br /> <b>Fatal error</b>:  Call to a member function getAdminLink() on a non-object in <b>/home4/flgames/public_html/pledgemanager.stonesterrain.com/cache/smarty/compile/16/37/9d/16379de0a2fba103e38269095078692fd8d151b4.file._print_pdf_icon.tpl.php</b> on line <b>34</b><br /> Edited by 9smiths (see edit history)
Link to comment
Share on other sites

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...