Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

KissER Error Handling & Debugging [contribution]


FWR Media

Recommended Posts

@@stefan21 Thank You! Exactly what I was looking for... :)

Link to comment
Share on other sites

  • 1 year later...

After upgrade to php7, I'm getting the following error in admin/categories.php:

Quote

Notice: Undefined offset: 8192 in /public_html/shop/admin/includes/kiss_error_handler.php on line 178

Line 178 in admin/includes/kiss_error_handler.php:

self::$registry['errors'][$errno][] = array( 'type'   => self::$error_types[$errno],
                                                   'string' => $errstr,
                                                   'file'   => $errfile,
                                                   'line'   => $errline );

Any idea how to fix that?

Edited by Irin
Nm, I just inserted E_DEPRECATED => 'E_DEPRECATED'.
Link to comment
Share on other sites

  • 1 month later...

Getting the following error when all the relevant files are uploaded to the server, including the modified includes/application_top.php and includes/functions/database.php. Trying to troubleshoot other issues but it seems that I need to troubleshoot this add-on first. Catch 22. Please help.

select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from currencies

[TEP STOP]

Link to comment
Share on other sites

  • 1 month later...
On 10/6/2017 at 7:16 PM, Irin said:

After upgrade to php7, I'm getting the following error in admin/categories.php:

Line 178 in admin/includes/kiss_error_handler.php:


self::$registry['errors'][$errno][] = array( 'type'   => self::$error_types[$errno],
                                                   'string' => $errstr,
                                                   'file'   => $errfile,
                                                   'line'   => $errline );

Any idea how to fix that?

Hi @Irin

Did you find the fix?

Thanks in advance :)

Link to comment
Share on other sites

I just read your edit reason.

In catalog/includes/kiss_error_handler.php find:

    private static $error_types = array( E_USER_ERROR  => 'E_USER_ERROR',  E_USER_WARNING => 'E_USER_WARNING',
                                         E_USER_NOTICE => 'E_USER_NOTICE', E_WARNING      => 'E_WARNING',
                                         E_NOTICE      => 'E_NOTICE',      E_ERROR        => 'E_ERROR',
                                         E_STRICT      => 'E_STRICT' );

and replace with:

    private static $error_types = array( E_USER_ERROR  => 'E_USER_ERROR',  E_USER_WARNING => 'E_USER_WARNING',
                                         E_USER_NOTICE => 'E_USER_NOTICE', E_WARNING      => 'E_WARNING',
                                         E_NOTICE      => 'E_NOTICE',      E_ERROR        => 'E_ERROR',
                                         E_STRICT      => 'E_STRICT',      E_DEPRECATED => 'E_DEPRECATED' );

Bests regards

Gustavo

Link to comment
Share on other sites

  • 4 years later...

This contribution still appears to be working well, reporting on even php8 errors.

However the installation might fail. In that case I found this replacement code to work:

Follow the instructions in the package and when it comes time to amend functions/database.php, replace with:

  function tep_db_query($query, $link = 'db_link') {
    global $$link;

    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
      error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    $start_time = microtime( true );
    $result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link));
    if ( class_exists( 'KissER' ) ) {
      KissER::q( round( ( microtime( true ) - $start_time ), 4 ), $query );
    }
    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
       $result_error = mysqli_error();
       error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }

    return $result;
  } 

 

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...