Search the Community
Showing results for tags 'debug-mode'.
-
In the newer version of prestashop i encountered a weird bug when you add the cart tot the back-end. the debug mode screenshot is below. and the code is below the screenshot. require 'config/config.inc.php'; require 'init.php'; session_start(); try { $id = isset($_SESSION['Cart_ID']) ? (int)$_SESSION['Cart_ID'] : null; $cart = new Cart($id, null); $cart->save(); // problem is just in this line $_SESSION['Cart_ID'] = $cart->id; if($_SERVER['REQUEST_METHOD'] === "POST") { if(isset($_POST['add_to_cart'], $_POST['id_product']) || !empty($_POST['id_product'])) { $cart->updateQty(1, $_POST['id_product']); $cart->update(); header("Location: index.php"); } } } catch (PrestaShopException $e) { echo $e; }
- 1 reply
-
- recent release state
- debug-mode
-
(and 2 more)
Tagged with:
-
Hi everyone, is there a way to turn off debug-mode programmatically? Just temporary. The debug mode helps a lot and I like to use it in my development, but in a most recent case it drives me realy crazy. I just want to (and I have to) handle an easy try catch scenario, wich cannot work due to exceptionHandler of Prestashop (at least in debug mode). Each throw gets caught by the exceptionHandler but not by MY catch block. I think the debug mode cause this behavior. I need to work with Transaction/Commit/Rollback and therefor I need my own exception handling in this case. I don't wand to disable the debug mode by hand. May be there is a way to set the exceptionHandler to NULL, just for the special run, or may be there is another alternative. Any suggestions? Some further information about my situation: I am devolping a module for Prestashop 1.7 and currently stucking in an AdminController Class.
-
- debug-mode
- programmatically
- (and 7 more)