PDA

View Full Version : Anyone ever set 'display_errors' to 1?


Andy
27-01-08, 18:40
In /includes/constants.inc.php, has anyone ever changed this:
ini_set('display_errors', 0); // php errors
to this:
ini_set('display_errors', 1); // php errors

???

I've just done it to find an error I was getting from alittle codey Ive been playing with. Imagine my suprise when I got this error message in search.php!!

Notice: Undefined variable: oProductDisplayListParams in /home/www/ROOT/SW/includes/elements/product_display_list.php on line 151

Notice: Undefined variable: oProductDisplayListParams in /home/www/ROOT/SW/includes/elements/product_display_list.php on line 151

Notice: Undefined variable: oProductDisplayListParams in /home/www/ROOT/SW/includes/elements/product_display_list.php on line 151

Notice: Undefined variable: oProductDisplayListParams in /home/www/ROOT/SW/includes/elements/product_display_list.php on line 151

Notice: Undefined variable: oProductDisplayListParams in /home/www/ROOT/SW/includes/elements/product_display_list.php on line 151

Notice: Undefined variable: bAutonomy in /home/www/ROOT/SW/includes/elements/product_display_list.php on line 370

Notice: Undefined variable: bAutonomy in /home/www/ROOT/SW/includes/elements/featured_merchants.php on line 91

Notice: Undefined property: oMerchant in /home/www/ROOT/SW/includes/elements/category_tree.php on line 36

Notice: Undefined property: oCategory in /home/www/ROOT/SW/includes/elements/category_tree.php on line 44

Notice: Undefined property: aChildren in /home/www/ROOT/SW/includes/elements/category_tree.php on line 161

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 164

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined property: aChildren in /home/www/ROOT/SW/includes/elements/category_tree.php on line 161

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 164

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined property: aChildren in /home/www/ROOT/SW/includes/elements/category_tree.php on line 161

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 164

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined property: aChildren in /home/www/ROOT/SW/includes/elements/category_tree.php on line 161

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 164

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined property: aChildren in /home/www/ROOT/SW/includes/elements/category_tree.php on line 161

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 164

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined property: aChildren in /home/www/ROOT/SW/includes/elements/category_tree.php on line 161

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 164

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined variable: oCategoryTreeParams in /home/www/ROOT/SW/includes/elements/category_tree.php on line 185

Notice: Undefined property: aChildren in /home/www/ROOT/SW/includes/elements/category_tree.php on line 161

It's a biggy ain't it??
All those variables are ShopWindow stuff, NOT create or manipulated by me, so I can only assume that these errors have always been there. the Line numbers will differ from most installations as ive made some big changes to mine, but none of the changes have unset any of these variables.

It'd explain some of the speed issues Ive been having. I'm working on an easy fix, which I'll post later.

Andy
27-01-08, 18:59
Got an easy fix for all those variables (not the properties, that's something different altogether)

Just incase anyone else finds these same problems, download the attachment, unzip and place UndefinedFix.php in the same directory as shopwindow's global.inc.php

Now, that needs to be called pretty much at the beginning of execution, so.....

open global.inc.php
right before the closing ?> add this:

if(file_exists('UndefinedFix.php')){
require_once('UndefinedFix.php');
}

That'll cut out all the undefined variables.

UndefinedFix.php simply defines all these variables with a NULL value right at the beginning of page execution. the problem is that some of these variables aren't always created, yet later on they are called regardless of whether they're set or not.