Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#2359 closed Bug/Fehler (duplicate)

Divison by zero Warning in xtcPrice Class

Reported by: noRiddle Owned by: somebody
Priority: normal Milestone: modified-shop-2.0.8.0
Component: Shop Version: 2.0.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

Hatte in einem Shop plötzlich dieses Warning:

Division by zero in File: /PATH/includes/classes/xtcPrice.php on Line: 760

Kommen dürfte das von Zeile 181 ff:

    if ((float)$pPrice == 0) {
      $pPrice = $this->getPprice($pID);
    }

und kommt vor wenn ein Preis in der Tabelle products auf 0.0000 steht, was vorkommen kann wenn man Artikel über eine Lieferanten-API automatisiert updatet.
Vorschlag dazu wäre den Code zu ändern in

    if (!((float)$pPrice > 0)) {
      $pPrice = $this->getPprice($pID);
    }

Gruß,
noRiddle

Attachments (0)

Change History (2)

comment:1 by noRiddle, 3 years ago

Sehe gerade, daß mein Vorschlag ja auch nichts bringt, weil die Funktion getPprice() den Preis ja auch aus der Tabelle products holt.
Das muß man wohl in der Funktion xtcFormatSpecialDiscount() direkt abfangen, indem man false return-t wenn $pPrice nicht > 0 ist.

Gruß,
noRiddle

comment:2 by Gerhard Waldemair, 3 years ago

Resolution: duplicate
Status: newclosed

Duplikat von Ticket #2318.

Last edited 3 years ago by Torsten Riemer (previous) (diff)

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.