Jump to content

Exception error, What could be causing this ?


shaununouk

Recommended Posts


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

Link to comment
Share on other sites

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 by bsmither
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by bsmither
Link to comment
Share on other sites

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_

 

 

 

Link to comment
Share on other sites

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 by bsmither
Link to comment
Share on other sites

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 by shaununouk
Link to comment
Share on other sites

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://

Link to comment
Share on other sites

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 by bsmither
Link to comment
Share on other sites

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);

 

Link to comment
Share on other sites

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 by bsmither
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...