Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: error.txt created by view.php  (Read 730 times)

Offline paulbg

  • Newbie
  • *
  • Posts: 18
  • Karma: +4/-0
    • View Profile
error.txt created by view.php
« on: December 27, 2021, 03:18:19 PM »
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:


« Last Edit: December 27, 2021, 03:30:16 PM by paulbg »

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5228
  • Karma: +261/-2
    • View Profile
Re: error.txt created by view.php
« Reply #1 on: December 28, 2021, 08:55:49 AM »
Hello.
Please upgrade AbanteCart to the latest version.
This are the PHP warnings for outdated code

Offline paulbg

  • Newbie
  • *
  • Posts: 18
  • Karma: +4/-0
    • View Profile
Re: error.txt created by view.php
« Reply #2 on: December 28, 2021, 11:38:33 AM »
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



Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5228
  • Karma: +261/-2
    • View Profile
Re: error.txt created by view.php
« Reply #3 on: December 29, 2021, 12:02:54 AM »
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

Offline paulbg

  • Newbie
  • *
  • Posts: 18
  • Karma: +4/-0
    • View Profile
Re: error.txt created by view.php
« Reply #4 on: December 31, 2021, 03:15:43 PM »
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');

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5228
  • Karma: +261/-2
    • View Profile
Re: error.txt created by view.php
« Reply #5 on: January 04, 2022, 12:39:34 AM »
Ask the hosting support to help you configure your php.ini file

 

Powered by SMFPacks Social Login Mod