Jump to content
thirty bees forum
  • 0

Bug in ajaxProcessLoadProductInformation function


Question

Posted

My shop version 1.1.x Bleeding Edge last release
The error log shows the following

2020/01/25 14:02:54 [error] 688#688: *1436 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined variable: currency in /home/vagrant/public_html/controllers/admin/AdminOrdersController.php on line 2713PHP message: PHP Notice:  Trying to get property 'decimals' of non-object in /home/vagrant/public_html/controllers/admin/AdminOrdersController.php on line 2713"

 

3 answers to this question

Recommended Posts

  • 0
Posted

Nice catch. That's when attempting to edit a product in an order in back office, bottommost panel, right?

I'm just curious how you managed to get this error message, I don't get it. Which kind of PHP is this?

Anyways, this small patch should fix it:

diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php
index b04f824fb9..100813972a 100644
--- a/controllers/admin/AdminOrdersController.php
+++ b/controllers/admin/AdminOrdersController.php
@@ -2710,7 +2710,7 @@ class AdminOrdersControllerCore extends AdminController
         }

         $decimals = 0;
-        if ($currency->decimals) {
+        if ($this->context->currency->decimals) {
             $decimals = Configuration::get('PS_PRICE_DISPLAY_PRECISION');
         }
         $this->ajaxDie(json_encode([
  • 0
Posted
On 1/26/2020 at 3:10 PM, Traumflug said:

Nice catch. That's when attempting to edit a product in an order in back office, bottommost panel, right?

Yes.

On 1/26/2020 at 3:10 PM, Traumflug said:

I'm just curious how you managed to get this error message, I don't get it. Which kind of PHP is this?

My currently php version:

PHP 7.3.10-1+0~20191008.45+debian9~1.gbp365209 (cli) (built: Oct  8 2019 05:48:14) ( NTS )

 

  • Like 1

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