2.0.15a - 2.0.15c Warning: Division by zero in calculationh.php

Started by lysov, December 02, 2012, 19:35:20 PM

Previous topic - Next topic

lysov

Hi, I got next messages (quantity messages = count products) at the FE category view
Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php

The url looks like
index.php?option=com_virtuemart&view=category&virtuemart_category_id=297&Itemid=819&lang=ru&language=ru-RU&orderby=`p`.product_sku
prices set for all products

Joomla 258, VM 2015a

Milbo

the error shows usually also the line, please tell me.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

Ah, sorry
Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php on line 1159 Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php on line 1159 Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php on line 1159

Milbo

a rule without value? Interesting, I think about to set a vmdebug
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

There are two rules, without taxes and not published  value added tax 18% (please see an attached image)

[attachment cleanup by admin]

Milbo

Exactly, the plublished rule has no value and has very likely no effect.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov


Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

Thnx Milbo, after update to 2015b:
Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php on line 1161 Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php on line 1161 Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php on line 1161

Milbo

Please post your line, I have if (strlen($mathop) == 2) { ?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

With pleasure (for v.2015b)
                  if(!empty($value)){
                     if($sign == $plus){
                        $calculated =  abs($price /(1 -  (100.0 / $value)));
                     } else {
                        $calculated = abs($price /(1 +  (100.0 / $value))); // line 1161

lysov

After update to 215c:
Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php on line 1173
Warning: Division by zero in /var/www/html/tests/victum/administrator/components/com_virtuemart/helpers/calculationh.php on line 1173
                                                if(!empty($value)){
                                                        if($sign == $plus){
                                                                $calculated =  abs($price /(1 -  (100.0 / $value)));
                                                        } else {
                                                                $calculated = abs($price /(1 +  (100.0 / $value))); // 1173
                                                        }