Projekt

Allgemein

Profil

Aktionen

GX-Bug #70378

geschlossen

SQL Fehlermeldung im Log wenn ein Artikel in der Datenbank nicht gefunden wird, der aber trotzdem noch im Warenkorb ist

Von Till Tepelmann vor etwa 1 Jahr hinzugefügt. Vor 9 Monaten aktualisiert.

Status:
Erledigt
Priorität:
Normal
Zugewiesen an:
Moritz Bunjes
Kategorie:
Core
Zielversion:
% erledigt:

0%

Geschätzter Aufwand:
Steps to reproduce:
Betroffene Versionen:
4.8.0.0 beta1
Release Notes Langtext:

Verbesserte Fehlerüberprüfung im Warenkorb


Beschreibung

SQL Fehlermeldung im Log wenn ein Artikel in der Datenbank nicht gefunden wird, der aber trotzdem noch im Warenkorb ist

Hier sollte vor dem SQL Befehl der Parameter für die Produkt ID zu einen integer gecasted werden um Fehler im SQL zu vermeiden


SQL error message in the log if a product is not found in the database, but is still in the shopping cart.

Here the parameter for the product ID should be cast to an integer before the SQL command to avoid errors in the SQL.


CRITICAL] SQL Error!
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
Query: SELECT `gm_min_order` FROM products WHERE products_id = 
context:
  session ID: session-63f37682a934f6.56053931
  exception:
    class: RuntimeException
    message: SQL Error!
      You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
      Query: SELECT `gm_min_order` FROM products WHERE products_id = 
    code: 1064
    file: /inc/xtc_db_error.inc.php
    line: 35
    trace:
      0: /inc/xtc_db_query.inc.php:69
                 {
                     # execute query
        ├─          $result = mysqli_query( $$link, $p_query) or xtc_db_error($p_query, ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)), ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
          
                     # save result to cache
      1: /includes/classes/shopping_cart.php:805
                  foreach ($this->contents as $products_id => $value) {
                      $qty = $this->contents[$products_id]['qty'];
        ├─             $product_query = xtc_db_query('SELECT `gm_min_order` FROM ' . TABLE_PRODUCTS . ' WHERE products_id = ' . xtc_db_input(xtc_get_prid($products_id)));
                      $product_min_order = xtc_db_fetch_array($product_query);
                      if ((float)$qty < (float)$product_min_order['gm_min_order']) {
      2: /includes/classes/shopping_cart.php:434



Aktionen

Auch abrufbar als: Atom PDF