Welcome Guest, Not a member yet? Register   Sign In
codeigniter error log file only shows notice error but error msg not shows on screen
#1
Question 
(This post was last modified: 09-28-2015, 09:13 PM by jazzrazor007.)

I have been literally pulling my hair out with this one and its beginning to delay the rest of my project and it really is getting me down.

The main point is that it's only showing me a notice error and 404 Error in error log file not on screen. Other notice errors shows on screen.

Why would codeigniter show errors in application/logs such as:

Code:
      ERROR - 2015-04-18 12:03:24 --> 404 Page Not Found --> uploaded_img
 
      ERROR - 2015-04-18 12:03:24 --> 404 Page Not Found --> images
 
      ERROR - 2015-04-18 12:03:24 --> 404 Page Not Found --> images
 
  // Above all three errors are shows only when i visit home page of my website and I am not calling any type of images class
 
      ERROR - 2015-04-18 11:30:14 --> Severity: Notice  --> Trying to get property of non-object D:\wamp\www\mywebsite\application\views\product_detail.php 2
         
      ERROR - 2015-04-18 11:30:14 --> Severity: Notice  --> Trying to get property of non-object D:\wamp\www\mywebsite\application\views\product_detail.php 3
         
     ERROR - 2015-04-18 11:30:14 --> Severity: Notice  --> Trying to get property of non-object D:\wamp\www\mywebsite\application\views\product_detail.php 4
 
  // Above all three errors are shown when i view product_detail.php page of my website.

My index.php is set at:

Code:
error_reporting(E_ALL | E_STRICT)

and config :

Code:
$config['log_threshold'] = 1;

Here is my Product controller class code:

Code:
class Product extends Frontend_Controller{

public function __construct(){
parent::__construct();
$this->load->model('product_m');
$this->load->library('cart');
}

public function index($str){
// fetch the article
$this->data['product_info'] = $this->product_m->get_product_detail($str);

// creating breadcrumb navigation path
$this->data['main_category'] = $this->uri->segment(1);
$this->data['sub_category'] = $this->uri->segment(2);
$this->data['current_location'] = str_replace('-', ' ',str_replace('.html', '', $this->uri->segment(3)));

// load view
$this->load->view('product_detail',$this->data);
}
}

when i do var_dump($this->data['product_info']);

Code:
object(stdClass)[18]
    public 'id' => string '24' (length=2)
    public 'parent_category' => string 'sweets' (length=6)
    public 'child_category' => string 'chikki-sweets' (length=13)
    public 'product_url' => string 'chikki-bom-bom.html' (length=19)
    public 'product_name' => string 'Chikki Bom Bom' (length=14)
    public 'product_desc' => string '<span style="font-weight: bold; font-size: 24px; font-family: Sans;">Chikki Bom Bom </span><span style="font-weight: bold; font-size: 24px; font-family: Verdana;">Chikki</span><span style="font-weight: bold; font-size: 24px; font-family: Sans;"> </span><span style="font-weight: bold; font-size: 24px; font-family: 'Comic Sans MS';">Bom Bom.</span><div><span style="font-family: 'Comic Sans MS'; font-size: 24px; font-weight: bold; line-height: 34.2857170104981px;"><br></span></div><div><pre><span style="font-f'... (length=1161)
    public 'product_sku' => string '123456789012' (length=12)
    public 'quantity' => string '23' (length=2)
    public 'price' => string '400.00' (length=6)
    public 'offer_price' => string '100.00' (length=6)
    public 'product_date' => string '2015-03-13' (length=10)
    public 'img_url_1' => string 'http://localhost/my_website/uploaded_img/chiki-boom-boom_1.png' (length=63)
    public 'img_url_2' => string 'http://localhost/my_website/uploaded_img/chikki_baadam_1.jpg' (length=61)
    public 'img_url_3' => string 'http://localhost/my_website/uploaded_img/white-rasbhari_1.jpg' (length=62)
    public 'img_url_4' => string 'http://localhost/my_website/uploaded_img/rasgulla_1.jpg' (length=56)
    public 'img_url_5' => null

Here is my product_detail.php code where its show's error:

Code:
  $total_product = (int) $product_info->quantity; // line number 2
  $mrp_price = (int) $product_info->price; // line number 3
  $offer_price = (int) $product_info->offer_price; // line number 4

Here i did  var_dump($product_info); on product_detail.php page:

Code:
object(stdClass)[18]
 public 'id' => string '24' (length=2)
 public 'parent_category' => string 'sweets' (length=6)
 public 'child_category' => string 'chikki-sweets' (length=13)
 public 'product_url' => string 'chikki-bom-bom.html' (length=19)
 public 'product_name' => string 'Chikki Bom Bom' (length=14)
 public 'product_desc' => string '<span style="font-weight: bold; font-size: 24px; font-family: Sans;">Chikki Bom Bom </span><span style="font-weight: bold; font-size: 24px; font-family: Verdana;">Chikki</span><span style="font-weight: bold; font-size: 24px; font-family: Sans;"> </span><span style="font-weight: bold; font-size: 24px; font-family: 'Comic Sans MS';">Bom Bom.</span><div><span style="font-family: 'Comic Sans MS'; font-size: 24px; font-weight: bold; line-height: 34.2857170104981px;"><br></span></div><div><pre><span style="font-f'... (length=1161)
 public 'product_sku' => string '123456789012' (length=12)
 public 'quantity' => string '23' (length=2)
 public 'price' => string '400.00' (length=6)
 public 'offer_price' => string '100.00' (length=6)
 public 'product_date' => string '2015-03-13' (length=10)
 public 'img_url_1' => string 'http://localhost/my_website/uploaded_img/chiki-boom-boom_1.png' (length=63)
 public 'img_url_2' => string 'http://localhost/my_website/uploaded_img/chikki_baadam_1.jpg' (length=61)
 public 'img_url_3' => string 'http://localhost/my_website/uploaded_img/white-rasbhari_1.jpg' (length=62)
 public 'img_url_4' => string 'http://localhost/my_website/uploaded_img/rasgulla_1.jpg' (length=56)
 public 'img_url_5' => null

What should i do to remove these error?
Reply
#2

do a var_dump in a view
Reply
#3

This looks like a reference problem, eg. "image" when a link should be "/image", or something similar.

Check you apache access log ... it should show how it is resolving your link.
Reply
#4

(04-18-2015, 10:17 AM)ciadmin Wrote: This looks like a reference problem, eg. "image" when a link should be "/image", or something similar.

Check you apache access log ... it should show how it is resolving your link.

I am newbie on codeigniter can you please explain it little more so i can understand what you said.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB