eCommerce construction > General Discussion

error.txt created by view.php

(1/2) > >>

paulbg:
Hi, any advice most welcome please.
This code error is out of my league of understanding so any help is greatly appreciated

The error.txt  code has recently begun, with no known changes to the site. It has been running perfectly for several years:

2021-12-27 19:01:32 - warning:  AbanteCart core v.1.2.10 count(): Parameter must be an array or an object that implements Countable in <b>/home/bearsofb/public_html/bearsofbath.co.uk/AbanteCart/core/engine/view.php</b> on line <b>569</b>

view.php:

   /**
    * return path to the template resource
    * @param string $path
    * @param string $filename
    * @param string $mode
    * @return mixed
    */
   private function _get_template_path($path, $filename, $mode){
      //look into extensions first
      $res_arr = $this->_extensions_resource_map($filename);
      //get first exact template extension resource or default template resource otherwise.
569      if (count($res_arr['original'])){
570         return $res_arr['original'][0];
571      } else if (count($res_arr['default'])){
572         return $res_arr['default'][0];
      }

      $template_path_arr = $this->_test_template_paths($path, $filename, $mode);
      return $template_path_arr['path'];
   }


The error.txt file is growing each day by 2.5GB and I have to keep deleting it to stop my quota overflowing:


Basara:
Hello.
Please upgrade AbanteCart to the latest version.
This are the PHP warnings for outdated code

paulbg:
I wish I could, thank-you though. I heavily modified the code, page layouts and index when I set this up in 2017. It has worked perfectly for years.
It would totally fall apart if I did and look terrible. AbanteCart theme does not suit this style of site.

The site still works ok and I have long retired from this kind of work, is it possible to disable the error.txt from being written? Or in someway disable the code that causes it. Some template call by the look of it.

Thanks


Basara:
Hello.
Most PHP warnings are not critical you can ignore or configure your PHP to not raise a warning in such cases
https://stackoverflow.com/a/62119277

paulbg:
I appreciate this info, I am working through were the error.txt is created from. Disable isn't in php.ini
Difficult to know which file to put

<?php
// Turn off all error reporting
error_reporting(0);
?>

I have done this but not having any effect:

Removed from:  AbanteCart/core/init.php. 

E_ALL


// Error Reporting
error_reporting(0);          //was.    E_ALL
require_once(DIR_CORE . '/lib/debug.php');
require_once(DIR_CORE . '/lib/exceptions.php');
require_once(DIR_CORE . '/lib/error.php');
require_once(DIR_CORE . '/lib/warning.php');

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Social Login Mod