Jump to content

Undefined variable: customerForm


paul

Recommended Posts

I have just upgrade 1.7.4.3 to 1.7.6.1 and get the following error when trying to edit a customer in the backend. There are similar reports in the French and German sections, without any resolution that I see.

---

Log trace

Undefined variable: customerForm

Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Notice: Undefined variable: customerForm" at /home/cpwsan6/public_html/test/src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php line 203

.. 

Stack Trace...

Symfony\Component\Debug\Exception\ContextErrorException: Notice: Undefined variable: customerForm at src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php:203 at PrestaShopBundle\Controller\Admin\Sell\Customer\CustomerController->editAction('16301', object(Request)) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, false) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200) at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, false) (admincpwsa/index.php:86)

---

Code line...

 

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')),

        ]);

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

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

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...