NemesisNG Posted August 9, 2019 Share Posted August 9, 2019 Hi Think I posted this in the wrong place first time... Just starting out with PrestaShop and running 1.7.6.0, have purchased a module to migrate us from OpenCart 3 which has been installed and run. Now on trying to view a customer to edit that person I'm getting a Error 500 page, but only on customers who have previously placed an order. If it's a customer whos registered and not ordered it will show the page no problem. I've contacted the dev of the migration module and they have done a test migration of our current OpenCart shop to their server and it's worked fine so said it's our install or hosting which is the issue. I've turned on debug mode and on clicking a customer to edit I get the following: Level Channel Message DEBUG18:23:41doctrineSELECT name FROM ps_module WHERE active = 1 INFO18:23:41requestMatched route "admin_customers_edit". DEBUG18:23:41securityRead existing security token from the session. DEBUG18:23:41securityUser was reloaded from a user provider. INFO18:23:41phpUser Deprecated: Tools::displayPrice() is deprecated since version 1.7.6.0. Use PrestaShop\PrestaShop\Core\Localization\Locale::formatPrice() instead. INFO18:23:41phpUser Deprecated: Implementing "Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "Csa\Bundle\GuzzleBundle\DataCollector\GuzzleCollector". CRITICAL18:23:41phpUncaught Notice: Undefined variable: customerForm CRITICAL18:23:41requestUncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Notice: Undefined variable: customerForm" at /home/ttocco/public_html/prestatest/src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php line 203 DEBUG18:23:41phpWarning: highlight_file() has been disabled for security reasons Any help on this or what to try next please? Thanks Link to comment Share on other sites More sharing options...
NemesisNG Posted August 12, 2019 Author Share Posted August 12, 2019 Anyone? Is this software supported? Link to comment Share on other sites More sharing options...
JBW Posted August 12, 2019 Share Posted August 12, 2019 (edited) Hi, the error message shows only that something went wrong when creatin/loading the customer edit form. As the issue seems to be related to your data migration I recommend to contact the developer of the migration module you used. Edited August 12, 2019 by JBW (see edit history) Link to comment Share on other sites More sharing options...
NemesisNG Posted August 12, 2019 Author Share Posted August 12, 2019 Thanks for replying. First thing I did was contact the developer of the migration package, they migrated our data to a local test shop of theirs and it seems to work fine, the sent a video to prove it, and said it was my shop setup not working correctly. But it's a brand new install of opencart 1.7.6.0 with no other mods or themes or anything installed or set up. I'm currently ignoring the GDPR issue of all of my shop data being on someone elses server! Don't know what else to do really, I've got a shop to migrate and setup, I'm £100 down for a migration module which isn't working and no support from them, and don't seem to be getting anywhere. Link to comment Share on other sites More sharing options...
JBW Posted August 12, 2019 Share Posted August 12, 2019 Is the same issue happing if you edit a new customer for which you have placed an order? If not it is somehow related to the migrated data - you can try to compare this data on database to see what might cause the issue. Link to comment Share on other sites More sharing options...
NemesisNG Posted August 12, 2019 Author Share Posted August 12, 2019 To be fair, I've not tried that. I've not even set up payments or shipping or anything yet as thought it best to get all the data moved over first and then configure. I'll try and run a test order through and see if I can edit that customer first, if not then it's clearly the migrated data. Thanks Link to comment Share on other sites More sharing options...
rachel01 Posted September 25, 2019 Share Posted September 25, 2019 Hi, I've the same problem Anyone have a solution ? thanks Link to comment Share on other sites More sharing options...
FranckR Posted September 27, 2019 Share Posted September 27, 2019 (edited) Hi, I had the same problem The issue was the column "convertion_rate" in the ps_orders table I guess in prestashop prior to 1.7.6.0 if you had only one currency the conversion rate wasn't mandatory but now it is and should be > 0.000000 So I updated the column convertion_rate in table ps_orders with '1.000000' by using the following SQL request : DO A BACKUP OF YOUR DATABASE BEFORE !!! AND IF YOUR USING MULTI CURRENCIES ON YOUR SHOP IT MIGHT MESS THINGS UP AND YOU SHOULD MAYBE ONLY UPDATE THE LINES WHERE IT'S 0,000000 UPDATE ps_orders SET conversion_rate = '1.000000' Hope this can help Edited September 27, 2019 by FranckR typo (see edit history) 2 Link to comment Share on other sites More sharing options...
rachel01 Posted September 27, 2019 Share Posted September 27, 2019 3 minutes ago, FranckR said: Hi, I had the same problem The issue was the column "convertion_rate" in the ps_orders table I guess in prestashop prior to 1.7.6.0 if you had only one currency the conversion rate wasn't mandatory but now it is and should be > 0.000000 So I updated the column convertion_rate in table ps_orders with '1.000000' by using the following SQL request : DO A BACKUP OF YOUR DATABASE BEFORE !!! AND IF YOUR USING MULTI CURRENCIES ON YOUR SHOP IT MIGHT MESS THINGS UP AND YOU SHOULD MAYBE ONLY UPDATE THE LINES WHERE IT'S 0,000000 UPDATE ps_orders SET conversion_rate = '1.000000' Hope this can help Hi, Thanks for your answer but I've a problem with the customers, not with the orders. You had problem with customers too ? Link to comment Share on other sites More sharing options...
FranckR Posted September 27, 2019 Share Posted September 27, 2019 Yes the problem was for editing customers : Back office / customers / customers the error 500 on some customers ( that had old orders ) I know it doesn't display the orders on the customer form but I think prestashop is requesting them anyway Link to comment Share on other sites More sharing options...
rachel01 Posted September 27, 2019 Share Posted September 27, 2019 It's was the solution ! Many thanks for your help ! Link to comment Share on other sites More sharing options...
NemesisNG Posted September 27, 2019 Author Share Posted September 27, 2019 On 9/25/2019 at 8:58 PM, rachel01 said: Hi, I've the same problem Anyone have a solution ? thanks Are you using the same migration module? Migrating from OpenCart? I never got this resolved and was fobbed off by the company making the module, basically said it was a problem in my old existing shop and on their test server it was fine. I've just tried this fix and it most certainly does fix this issue! Can't quite believe it to be honest. Now, I've also got an issue with missing category and product names after the migration too, the company making the module did actually fix this but didn't tell me what the fix was, so as I'm still in testing and not on a final live shop migration I need to them to either do it again or let me know how to sort it myself. Unless anyone else has any bright ideas? Thanks Link to comment Share on other sites More sharing options...
NemesisNG Posted September 27, 2019 Author Share Posted September 27, 2019 9 hours ago, FranckR said: Hi, I had the same problem The issue was the column "convertion_rate" in the ps_orders table I guess in prestashop prior to 1.7.6.0 if you had only one currency the conversion rate wasn't mandatory but now it is and should be > 0.000000 So I updated the column convertion_rate in table ps_orders with '1.000000' by using the following SQL request : DO A BACKUP OF YOUR DATABASE BEFORE !!! AND IF YOUR USING MULTI CURRENCIES ON YOUR SHOP IT MIGHT MESS THINGS UP AND YOU SHOULD MAYBE ONLY UPDATE THE LINES WHERE IT'S 0,000000 UPDATE ps_orders SET conversion_rate = '1.000000' Hope this can help Absolutely amazing, many, many thanks for posting this! Link to comment Share on other sites More sharing options...
charlie404 Posted October 10, 2019 Share Posted October 10, 2019 Hello, I have the same problem. I have a 500 error on some customers but not on all ... Example of the url: https://mysite.com/index.php/sell/customers/9999 I really do not know why it works on some clients and not on others. If someone has an idea. Thank you Link to comment Share on other sites More sharing options...
boutik-fan Posted October 11, 2019 Share Posted October 11, 2019 Thank you for the help. In my ps_orders table the currency was ok everywhere. But I noticed that a customer has id_currency set to 0 (I have only one currency). So I replaced to 1 and no more error 500 on this customer ! Link to comment Share on other sites More sharing options...
charlie404 Posted October 11, 2019 Share Posted October 11, 2019 Thank you for your answer. In my ps_orders table, all id_currency values are at 1. I do not have the id_currency field in my ps_customer table ... Link to comment Share on other sites More sharing options...
FranckR Posted October 11, 2019 Share Posted October 11, 2019 In ps_orders check the value of convertion_rate column not id_currency Link to comment Share on other sites More sharing options...
charlie404 Posted October 11, 2019 Share Posted October 11, 2019 In ps_orders table, all conversion_rate values are at 1.000000 Link to comment Share on other sites More sharing options...
Lukas Truninger Posted November 7, 2019 Share Posted November 7, 2019 Similar issue here. I did just check database. - id_currency reads either 1 or 2; no empty record nor value "0" ( I use EUR and USD) - all conversion rates are either set to 1 or the the real conversion rate (for USD). No empty records. Nevertheless I endup with error 500 when trying to edit most customers. But it looks like I can edit customers who did NOT place an order yet, and all the customers which I cannot edit already have placed an order. I have this issue also for recently new added customers who did create their account running PS 1.7.6.0 / 1.7.6.1 I also endup with error 500 if I try to set the order state to "payment accepted". Other order states work fine. May be there is another field which causes this issue? Link to comment Share on other sites More sharing options...
ITIS-Commerce.com Posted December 18, 2019 Share Posted December 18, 2019 Hello Yes, the solution is to place this SQL order : UPDATE ps_orders SET conversion_rate = '1.000000' Don't forget to backup your database before. Great day! Link to comment Share on other sites More sharing options...
Greg1234 Posted January 8, 2020 Share Posted January 8, 2020 I had the same issue, but no of the above solutions worked. - in my ps_orders convertions_rate was set to 1.000000 - in my ps_customer the id_currency doesn't exist - in ps_orders id_currency was not 0 After making a small investigation I've found out that my payment module was using in its code wrong path to its files, instead of _PS_MODULE_DIR_ ."/modulename/rest/path" it was using hardcoded "modules/modulename/rest/path" which when run from some other controller was an incorrect path. But this is my fault (I wrote this module for myself). The real issue is, that CustomerController.php is wrongly written. As I understand, the function editAction() has serious mistake: try { // create object of $customerForm // create some other variables // if any of those created object fails (eg. wrong module path etc.) then go to "catch" part, } catch(Exception $e){ if($e instanceof CustomerNotFoundException){ return } // and here goes the incorrect part, if the error is didfferent than customerNotFound then the script continues as everything was fine } // So if the exception is anything else than CustomerNotFoundException it executes following code: return $this->render('@PrestaShop/Admin/Sell/Customer/edit.html.twig', [ 'customerForm' => $customerForm->createView(), 'customerInformation' => $customerInformation, 'isB2bFeatureActive' => $this->get('prestashop.core.b2b.b2b_feature')->isActive(), 'minPasswordLength' => Password::MIN_LENGTH, 'help_link' => $this->generateSidebarLink($request->attributes->get('_legacy_controller')), ]); //the problem is that $customerForm doesn't exists here as it went to the "catch" part - no $customerForm creation. So for everyone who struggles with this error, I'd recommend temporary (!) changing this function so you see what exactly causes your problem: replace ONLY TEMPORARY this code(file src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php function editAction(), line 195): } catch (Exception $e) { $this->addFlash('error', $this->getErrorMessageForException($e, $this->getErrorMessages($e))); if ($e instanceof CustomerNotFoundException) { return $this->redirectToRoute('admin_customers_index'); } } with this: } catch (Exception $e) { /** @var ViewableCustomer $customerInformation */ $customerInformation = $this->getQueryBus()->handle(new GetCustomerForViewing((int) $customerId)); $customerFormOptions = [ 'is_password_required' => false, ]; $customerForm = $this->get('prestashop.core.form.identifiable_object.builder.customer_form_builder') ->getFormFor((int) $customerId, [], $customerFormOptions); $customerForm->handleRequest($request); $customerFormHandler = $this->get('prestashop.core.form.identifiable_object.handler.customer_form_handler'); $result = $customerFormHandler->handleFor((int) $customerId, $customerForm); $this->addFlash('error', $this->getErrorMessageForException($e, $this->getErrorMessages($e))); if ($e instanceof CustomerNotFoundException) { return $this->redirectToRoute('admin_customers_index'); } } Now open again the customer edit page, and it should show you the real error of your case. AFTER SEEING WHAT IS THE ERROR REMEMBER TO RESTORE THE CHANGED CODE OF CustomerController.php TO HOW IT WAS BEFORE. 1 Link to comment Share on other sites More sharing options...
Lukas Truninger Posted January 8, 2020 Share Posted January 8, 2020 Finally someone who cares about this terrible bug of PS. Thanx Greg for this post. However, I see still the same (standard) 500 Error. Do I need to delete some cache files? which ones? Thanx Link to comment Share on other sites More sharing options...
Greg1234 Posted January 8, 2020 Share Posted January 8, 2020 44 minutes ago, Lukas Truninger said: Finally someone who cares about this terrible bug of PS. Thanx Greg for this post. However, I see still the same (standard) 500 Error. Do I need to delete some cache files? which ones? Thanx Hm.. sure you can try to delete the cache, as far as I know deleting cache can not make any harm. So delete everything in 'var/cache/dev' and in 'var/cache/prod' Link to comment Share on other sites More sharing options...
Lukas Truninger Posted January 9, 2020 Share Posted January 9, 2020 Hmmm, also after deleting the cache, all I see is: "Oops! An Error Occurred The server returned a "500 Internal Server Error". Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused." Link to comment Share on other sites More sharing options...
Greg1234 Posted January 13, 2020 Share Posted January 13, 2020 (edited) I am not backend developer, but my guess how to investigate this would be to add below line 195 this two lines (echo... and var_dump...). so it looks like this: 195 } catch (Exception $e) { 196 echo $this->getErrorMessageForException($e, $this->getErrorMessages($e)) 197 var_dump($e); 198 $this->addFlash('error', $this->getErrorMessageForException($e, $this->getErrorMessages($e))); And then maybe you can see what causes the problem in your case. It should show you all the information about the error variable. Edited January 13, 2020 by Greg1234 (see edit history) Link to comment Share on other sites More sharing options...
Lukas Truninger Posted January 15, 2020 Share Posted January 15, 2020 Unfortunately, this also does not show any new results. It looks like the error is already produced in line 178 $this->addGroupSelectionToRequest($request); thus we will never get to the "try" nor "catch Exeption ... => If I write debugg code print_r("test");exit; before line 178, the I see "test" on the website; If I write this debug code after line 178, the I see the standard Error 500 message. Link to comment Share on other sites More sharing options...
Bob van der Valk Posted March 31, 2020 Share Posted March 31, 2020 I had the same with migration pro from zencart to PS. Original conversion was to PS 1.7.5.1 and there I could open customer pages that ordered in the past. In 1.7.6.0 and 1.7.6.4 I could open orders but not the related customer pages: error 500 UPDATE ps_orders SET conversion_rate = '1.000000' fixed my problem. Many thanks ! Conversion rate was 0.00000 Link to comment Share on other sites More sharing options...
Lukas Truninger Posted April 22, 2020 Share Posted April 22, 2020 The conversion rates of all orders in ps_orders is 1.000000. Thus, this is not the issue in my case. Problem is still not solved!! Also, the same problem persists for new orders created in prestashop. It is not an issue of imported records. Link to comment Share on other sites More sharing options...
Doctoremote Posted June 5, 2020 Share Posted June 5, 2020 (edited) Hi, this post relates to 1.7.6.2 and above. Not sure about below. The error is normally caused by imported data from other carts like ZEN cart and Open Cart. They do not have the fields that Presta shop requires. Hence when you click on a imported customer then the details are not found and a MySql error occurs - hence ERROR 500. Most of this is imported old orders which have prestashop mysql fields in ps_orders set to zero. Try this but BACKUP YOUR DATABASE FIRST. From the Advanced Paramaters tab on the left menu select database Select SQL Manager Create the following indiviually and then action with the cloud icon. You may get an error of 500 on each action but do not worry. Name SQL STATEMENT roundtype UPDATE ps_orders SET round_type = '1' rates UPDATE ps_orders SET conversion_rate = '1.000000' round mode UPDATE ps_orders SET round_mode = '2' Payment by PayPal UPDATE ps_orders SET payment = 'Payment by PayPal' Site UPDATE ps_orders SET id_shop_group = '1' recycle UPDATE ps_orders SET recyclable = '0' Once these MYSQL actions have happened you should be able to edit your customers. This worked for me, after a zencart import of orders. Let me know if it works for you.... Doctoremote Edited June 5, 2020 by Doctoremote (see edit history) Link to comment Share on other sites More sharing options...
Lukas Truninger Posted June 10, 2020 Share Posted June 10, 2020 Thanx for this hints. Unfortunately, this does not solve the issue. All menthiod fields contains valid values. Further, I do not only get the Error 500 when I try to open an address from an imported customer. I also have the same issue with customers that created their user account in prestashop. Further I think that it has to be something with one of the addresses / customers data base rather than order databas. I can see all orders without problems, but not the addresses. Link to comment Share on other sites More sharing options...
Tooltek Posted August 6, 2020 Share Posted August 6, 2020 Hi, I was facing this problem today with PS 1.7.6.1. Problem was wrong email format in DB. I don't know how customer could enter a wrong email address, but it was like [email protected] with a dot before @ I updated email address and my error disappeared. I think this error is due to the wrong data format in the database. Hope this help. Link to comment Share on other sites More sharing options...
Lukas Truninger Posted August 22, 2020 Share Posted August 22, 2020 (edited) I did update to 1.7.6.7 and I did hope that this solves this terrible issue - but NO. It does still not work. And once again: the issue has nothing to do with imported database. The issue happens with customer accounts created under Prestashop. - As long a customer has not placed an order, I can edit the customer - if customer has placed an order, I can still edit his address, but if I like to access the customer edit page (either from the order or the customer list), I endup with error 500. I did investigate some more and found out which line of code creates the Error 500: file: src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php function editAction(), line 203: (version 1.7.6.7) $customerInformation = $this->getQueryBus()->handle(new GetCustomerForViewing((int) $customerId)); If I comment out this line of code, things seams to work OK. The edit window opens and shows the correct customer Information....?? Even if $customerInformation content is NULL ...??? I have no idea how data is passed here? Anyone can explain / solve? Thanx Edited August 22, 2020 by Lukas Truninger updated (see edit history) Link to comment Share on other sites More sharing options...
karpoj23 Posted August 30, 2020 Share Posted August 30, 2020 I have the same problem with this line: $customerInformation = $this->getQueryBus()->handle(new GetCustomerForViewing((int) $customerId)); Link to comment Share on other sites More sharing options...
Jluis Posted September 21, 2020 Share Posted September 21, 2020 hello , i have the same problem with a specific Customer , is someone have resolved the problem ? Link to comment Share on other sites More sharing options...
Lukas Truninger Posted September 21, 2020 Share Posted September 21, 2020 7 minutes ago, Jluis said: hello , i have the same problem with a specific Customer , is someone have resolved the problem ? Unfortunately not. It's a bug of Prestashop, but it looks that they are not interested in fixing it. This ticket is now 1 year old, but the bug is still there in latest Prestashop version .... Link to comment Share on other sites More sharing options...
Jluis Posted September 21, 2020 Share Posted September 21, 2020 thanks @Lukas , so no way to debug the problem ? Link to comment Share on other sites More sharing options...
tintti Posted November 3, 2020 Share Posted November 3, 2020 Hello, I have also similar problem. I had 76 customers with addresses, 72 of them has been migrated 2 months ago and 4 has logged after that. I tried to upgrade 1.7.6. 5 to 1.7.8. did not manage, but lost the cusotemers - shows only one test customer created 2016, but 68 adresses are still there. Customers can´t login at all. We use this shop as a cataloque mainly for reseller and have therefore no orders at all. So this is a bit different than the versions above. - Tintti Link to comment Share on other sites More sharing options...
winniezz Posted January 25, 2021 Share Posted January 25, 2021 Delete all lines in ps_cart with this id_customer and error will disappear. 1 Link to comment Share on other sites More sharing options...
prestasafe Posted March 5, 2021 Share Posted March 5, 2021 Hi, i've put a dump in the controller to see what's happened: catch (Exception $e) { dump($e); die(); $this->addFlash('error', $this->getErrorMessageForException($e, $this->getErrorMessages($e))); if ($e instanceof CustomerNotFoundException) { return $this->redirectToRoute('admin_customers_index'); } } And i saw that the customer put his phone number in his lastname, and it was not valided by PrestaShop, so i have changed it in the DB. It works fine now; Link to comment Share on other sites More sharing options...
AnthonyJane Posted April 1, 2022 Share Posted April 1, 2022 On 1/25/2021 at 8:17 PM, winniezz said: Delete all lines in ps_cart with this id_customer and error will disappear. In my specific instance the issue is that in PS 1.6 you can have a cart record that has an id_address_delivery or id_address_invoice value that does not exist in the address table. However in PS 1.7 these values have to be valid or 0. So if you migrate data from PS1.6 to a PS 1.7 you need to clear out any invalid id_address_delivery or id_address_invoice values from the cart table. If you do not do this you will not be able to view or edit some customer records. Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted December 14, 2023 Share Posted December 14, 2023 Hello, i have same problem come only specific customer not all customer after migrate data ps 1.6 to 1.7. i can not edit customer in admin and not view order in admin Thank you Link to comment Share on other sites More sharing options...
escri2 Posted February 29 Share Posted February 29 The problem with editing clients and getting the "Oops! An Error Occurred" error is because some data that has been imported from an external program is invalid for Prestashop, such as there being numbers in the last name, like this --> 2014 S.L, then when editing the client, it gives an error. 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