From 75fd8a007a74ffa22161d3f1df7d03a8c3fbb4b2 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 28 Mar 2022 19:01:09 +0530 Subject: [PATCH] Resolve notice issue on book now page --- classes/Tools.php | 4 +++- config/smarty.config.inc.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 8fc419740..a9546d174 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -2643,10 +2643,12 @@ exit; $backtrace = debug_backtrace(); $callee = next($backtrace); $class = isset($callee['class']) ? $callee['class'] : null; + $callee['file'] = isset($callee['file']) ? $callee['file'] : ''; + $callee['line'] = isset($callee['line']) ? $callee['line'] : ''; if ($message === null) { $message = 'The function '.$callee['function'].' (Line '.$callee['line'].') is deprecated and will be removed in the next major version.'; } - $error = 'Function '.$callee['function'].'() is deprecated in '.$callee['file'].' on line '.$callee['line'].'
'; + $error = 'Function: '.$callee['function'].'() is deprecated in file: '.$callee['file'].' on line: '.$callee['line'].'
'; Tools::throwDeprecated($error, $message, $class); } diff --git a/config/smarty.config.inc.php b/config/smarty.config.inc.php index 7252ee7c5..9395d9021 100644 --- a/config/smarty.config.inc.php +++ b/config/smarty.config.inc.php @@ -93,8 +93,8 @@ smartyRegisterFunction($smarty, 'function', 'd', 'smartyDieObject'); // Debug on smartyRegisterFunction($smarty, 'function', 'l', 'smartyTranslate', false); smartyRegisterFunction($smarty, 'function', 'hook', 'smartyHook'); smartyRegisterFunction($smarty, 'function', 'toolsConvertPrice', 'toolsConvertPrice'); -smartyRegisterFunction($smarty, 'modifier', 'json_encode', array('Tools', 'jsonEncode')); -smartyRegisterFunction($smarty, 'modifier', 'json_decode', array('Tools', 'jsonDecode')); +smartyRegisterFunction($smarty, 'modifier', 'json_encode', 'json_encode'); +smartyRegisterFunction($smarty, 'modifier', 'json_decode', 'json_decode'); smartyRegisterFunction($smarty, 'function', 'dateFormat', array('Tools', 'dateFormat')); smartyRegisterFunction($smarty, 'function', 'convertPrice', array('Product', 'convertPrice')); smartyRegisterFunction($smarty, 'function', 'convertPriceWithCurrency', array('Product', 'convertPriceWithCurrency'));