shaununouk Posted June 17 Share Posted June 17 I have had this recurring "exception error" since a previous update a while back, cannot remember which one though, I believe it may be an extension error, possibly an ebay one and will have to contact noodleman the developer if so as I only use paypal, Amzin by nitefox template and by price shipping module, nothing else, Just though I would mention this error on the forums to see if any one else recognises this error with smarty or is this a template error? Today, 14:30 [<strong>Exception</strong>] /home/***********/public_html/includes/lib/smarty/sysplugins/smarty_internal_undefined.php:62 - undefined extension class 'Smarty_Internal_Method_MuteExpectedErrors' https:// Today, 14:00 [<strong>Exception</strong>] /home/*********/public_html/includes/lib/smarty/sysplugins/smarty_internal_undefined.php:62 - undefined extension class 'Smarty_Internal_Method_MuteExpectedErrors' https:// Any help, or advice, always appreciated. Version 6.5.1 PHP 7.4.3 Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17 Share Posted June 17 (edited) If this is coming from an extension, it puzzles me why the extension would feel it necessary to do the same thing that is done in: /controllers/controller.admin.pre_session.inc.php (line 38) /controllers/controller.index.inc.php (line 44) where the earlier versions of CubeCart uses Smarty v3, and later versions of CubeCart uses Smarty v4. Smarty v3 uses the command muteExpectedErrors() and Smarty v4 uses the command muteUndefinedOrNullWarnings(). So, check those two files to see if there is a mismatch. But how recurring is it? If the fault is in the controller files, the exception would happen all the time, every time, CubeCart starts up. Edited June 17 by bsmither Quote Link to comment Share on other sites More sharing options...
shaununouk Posted June 17 Author Share Posted June 17 Hello and thanks for the reply, I just took a guess that the extension may have been a problem as no one else mentioned this "exception error" problem on the forum as websites are upgraded to latest versions on regular occasions. I have checked the files you have mentioned in /controllers/controller.admin.pre_session.inc.php (line 38) /controllers/controller.index.inc.php (line 44) and both line numbers show the same code $GLOBALS['smarty']->muteUndefinedOrNullWarnings(); so assume Smarty v4. is installed correctly. This error is the only one I receive and is constant at around 96 times every 24 hours, I have limited the error log to one day. So no idea what may be causing this. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17 Share Posted June 17 (edited) If you see this in the System Error log, then maybe the stack trace is recorded. If so, hover the mouse cursor over the message column of the row in the list that has the error. If there is a stack trace, a "tooltip" will popup next to the cursor, the tooltip showing the functions and files that caused the error. Edited June 17 by bsmither Quote Link to comment Share on other sites More sharing options...
shaununouk Posted June 17 Author Share Posted June 17 No tooltip popups occur on the page, as just all text apart from debug mode link and clear error logs link System Error Log Notice Error - These are unlikely to cause operatinal problems and can be thought of as best practice recommendations. Action is not required. Warning Error - These are unlikely to cause operational problems now but there is a problem, one that is likely to cause bigger issues in the future. Action is recommended. Parse Error - These are caused by misused or missing symbols in a syntax. Action is required. Fatal Error - These are are classified as critical errors. Action is required. Exception Error - These are are classified as critical errors. Action is required. Note: Your store should only log notice and warning errors if it is in debug mode. [Clear error logs] Date Message Today, 21:30 [<strong>Exception</strong>] /home/******/public_html/includes/lib/smarty/sysplugins/smarty_internal_undefined.php:62 - undefined extension class 'Smarty_Internal_Method_MuteExpectedErrors' https:// Today, 21:30 [<strong>Exception</strong>] /home/******/public_html/includes/lib/smarty/sysplugins/smarty_internal_undefined.php:62 - undefined extension class 'Smarty_Internal_Method_MuteExpectedErrors' https:// Today, 21:00 [<strong>Exception</strong>] /home/******/public_html/includes/lib/smarty/sysplugins/smarty_internal_undefined.php:62 - undefined extension class 'Smarty_ Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17 Share Posted June 17 (edited) Ok, I wasn't recalling if Exceptions recorded the stack trace. It doesn't. So, let's make an edit so that it does: In /classes/debug.class.php, near line 504, find: $this->_writeErrorLog($message, 'Exception'); Change to: $backtrace = debug_backtrace(); array_shift($backtrace); ob_start(); array_walk($backtrace, function($a){ if(!empty($a['line'])) {print $a['function']."() (".basename($a['file']).":".$a['line'].")\n";}}); $backtrace = ob_get_contents(); ob_end_clean(); $this->_writeErrorLog($message, 'Exception', $backtrace); Next time an Exception gets logged, the stack trace should be there. Edited June 17 by bsmither Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17 Share Posted June 17 OOps! Made a mistake. The last line above I just changed to what it should be. Quote Link to comment Share on other sites More sharing options...
shaununouk Posted June 17 Author Share Posted June 17 (edited) I have copied the lines of code in but have now lost the error message, it is blank except except for the https:// which just leads to about:blank#blocked. As time is getting late in UK, I shall look into this later, Thanks very much for taking the time and effort to help solve this error. You are very helpful to so many on the cubecart forums. I have just seen your last post and will paste the new code in as requested and get back to you another time, thanks Edited June 17 by shaununouk Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 17 Share Posted June 17 Please reload this forum conversation. I made a mistake on the last line of the new code. 1 Quote Link to comment Share on other sites More sharing options...
shaununouk Posted June 18 Author Share Posted June 18 Error message has now come back but exactly same format as before, no tooltip pop up link either afraid to say. [<strong>Exception</strong>] /home/********/public_html/includes/lib/smarty/sysplugins/smarty_internal_undefined.php:62 - undefined extension class 'Smarty_Internal_Method_MuteExpectedErrors' https:// Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 18 Share Posted June 18 That's odd. I will give this some more thought. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 18 Share Posted June 18 (edited) Please try these new statements (to replace the previous new statements): $backtrace = $e->getTrace(); //array_shift($backtrace); ob_start(); array_walk($backtrace, function($a){ if(!empty($a['line'])) {print $a['function']."() (".basename($a['file']).":".$a['line'].")\n";}}); $backtrace = ob_get_contents(); ob_end_clean(); if (empty($backtrace)) $backtrace = 'No Backtrace.'; $this->_writeErrorLog($message, 'Exception', $backtrace); Edited June 18 by bsmither Quote Link to comment Share on other sites More sharing options...
shaununouk Posted June 18 Author Share Posted June 18 We have a tooltip now appearing showing: __call() (smarty_internal_extension_handler.php:133) _callExternalMethod() (smarty_internal_data.php:270) Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 18 Share Posted June 18 Ugh! I was hoping for a few more lines. Like, what calls _callExternalMethod() and what calls that, all the way to index.php. Well, let's see what smarty_internal_data.php has to say. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 18 Share Posted June 18 Ok, let's also do this: In the file /includes/lib/smarty/sysplugins/smarty_internal_undefined.php, near line 59, find: public function __call($name, $args) { if (isset($this->class)) { throw new SmartyException("undefined extension class '{$this->class}'"); Change to: public function __call($name, $args) { if (isset($this->class)) { ob_start(); debug_print_backtrace(); $backtrace = ob_get_contents(); ob_end_clean(); throw new SmartyException("undefined extension class '{$this->class}'\n".$backtrace); Quote Link to comment Share on other sites More sharing options...
shaununouk Posted June 18 Author Share Posted June 18 Thank you, I have done the above, will send you a message and big file! Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 18 Share Posted June 18 (edited) The trace indicated that: /aa/bb/public_html/modules/plugins/ebay_sales/cron/cron_ebaySales_processor.php is the culprit. HTML Templates are fully supported You can have as many HTML templates as you need HTML templates can be enabled/disabled at product level If you are not using a HTML template, the HTML code in your product description is your ebay product description HTML templates use "tags" which will be replaced with item specific information such as description/title/return policy HTML templates can be added/updated/deleted The one about using "tags" implies that the templates will be fed through Smarty. Thus, being a good idea to suppress errors, the publisher of Ebay Sales Plugin will need to make the edit to use Smarty v4 method call. (I am confident that cron_ebaySales_processor.php is not human-readable, and there may be more of this plugin's code that might need to be rewritten for Smarty v4.) Edited June 18 by bsmither Quote Link to comment Share on other sites More sharing options...
shaununouk Posted June 19 Author Share Posted June 19 Thank you Bsmither for your time and effort looking into this error for me, I have now updated to the latest version available of the eBay sales module and hopefully this latest version will solve a lot of errors or problems that have been happening. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.