Author Topic: 2.0.15a - 2.0.15c Warning: Division by zero in calculationh.php  (Read 4864 times)

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2.0.15a: Warning: Division by zero in calculationh.php
« Reply #1 on: December 02, 2012, 23:55:25 pm »
the error shows usually also the line, please tell me.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: 2.0.15a: Warning: Division by zero in calculationh.php
« Reply #2 on: December 03, 2012, 09:14:00 am »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2.0.15a: Warning: Division by zero in calculationh.php
« Reply #3 on: December 03, 2012, 13:09:04 pm »
a rule without value? Interesting, I think about to set a vmdebug
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: 2.0.15a: Warning: Division by zero in calculationh.php
« Reply #4 on: December 03, 2012, 20:27:59 pm »
There are two rules, without taxes and not published  value added tax 18% (please see an attached image)

[attachment cleanup by admin]

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2.0.15a: Warning: Division by zero in calculationh.php
« Reply #5 on: December 04, 2012, 12:45:29 pm »
Exactly, the plublished rule has no value and has very likely no effect.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: 2.0.15a: Warning: Division by zero in calculationh.php
« Reply #6 on: December 04, 2012, 13:04:48 pm »
I fully share your opinion

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2.0.15a: Warning: Division by zero in calculationh.php
« Reply #7 on: December 04, 2012, 13:17:02 pm »
btw should be fixed in 15b
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: 2.0.15a: Warning: Division by zero in calculationh.php
« Reply #8 on: December 04, 2012, 14:24:55 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10094
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2.0.15a - 2.0.15b Warning: Division by zero in calculationh.php
« Reply #9 on: December 06, 2012, 00:01:36 am »
Please post your line, I have if (strlen($mathop) == 2) { ?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lysov

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: 2.0.15a - 2.0.15b Warning: Division by zero in calculationh.php
« Reply #10 on: December 06, 2012, 07:37:54 am »
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

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 105
    • Litera ltd
Re: 2.0.15a - 2.0.15c Warning: Division by zero in calculationh.php
« Reply #11 on: December 12, 2012, 10:03:06 am »
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
                                                        }