Zen Cart Logo
Forums / General Questions / HELP! Footer Disappear on Categories only

HELP! Footer Disappear on Categories only

Views: 1,067

Results 1 to 11 of 11
31 Aug 2015, 10:27 AM
#1
green_books avatar

green_books

New Zenner

Join Date:
Nov 2013
Location:
Hong Kong
Posts:
44
Plugin Contributions:
0

HELP! Footer Disappear on Categories only

Hi,

The footer area is missing in my category pages (For example: http://www.brightenbooks.com.hk/index.php?main_page=index&cPath=23)

There is this warning on the bottom of categories, where the footer should display.
"WARNING: An Error occurred, please refresh the page and try again."

Here is the content in the LOG file:
PHP Warning: Creating default object from empty value in /home/brightenbookscom/public_html/administrator/categories.php on line 1042

I guess I've fix this with the solution in the following thread:
https://www.zen-cart.com/showthread.php?200601-Done-v1-5-4-PHP-5-4-PHP-Warning-Creating-default-object-from-empty-value

I added one line in the categories.php, and problem fixed. Only that the footer still disappeared.:no:

 if (empty($pInfo->products_id)) { 
$pInfo = new stdClass();     
$pInfo->products_id= $pID; 

BTW, this problem only happened in the categories, the footer does display in Home, product info page and even in EZ-page. And I can't find any threads that similar to my problem.

Any idea?

Thanks,
Eva

31 Aug 2015, 11:45 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: HELP! Footer Disappear on Categories only

One place to start would be to switch back temporarily to the Classic template and see if the problem still exists. If not, you can compare the files in your template with those in the Classic template which deal with the footer.

31 Aug 2015, 12:03 PM
#3
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: HELP! Footer Disappear on Categories only

first of all you need to change the name of your admin folder, because you just made it public.

second, the log file entry you quoted is from the admin side, not the store front, so it has nothing to do with the disappearing footer. There are probably more log files. Find one that looks like myDEBUG-1440930163-99038.log, and not myDEBUG-adm-1440930163-99038.log
Also the quoted message is a warning, not a fatal error, which is also an indicator this is not the logfile you are looking for, because it does not resolve in a (partial) white page.

Green Books:

Hi,

The footer area is missing in my category pages (For example: http://www.brightenbooks.com.hk/index.php?main_page=index&cPath=23)

There is this warning on the bottom of categories, where the footer should display.
"WARNING: An Error occurred, please refresh the page and try again."

Here is the content in the LOG file:
PHP Warning: Creating default object from empty value in /home/brightenbookscom/public_html/administrator/categories.php on line 1042

I guess I've fix this with the solution in the following thread:
https://www.zen-cart.com/showthread.php?200601-Done-v1-5-4-PHP-5-4-PHP-Warning-Creating-default-object-from-empty-value

I added one line in the categories.php, and problem fixed. Only that the footer still disappeared.:no:

if (empty($pInfo->products_id)) {
$pInfo = new stdClass();
$pInfo->products_id= $pID;

> 
> BTW, this problem only happened in the categories, the footer does display in Home, product info page and even in EZ-page. And I can't find any threads that similar to my problem.
> 
> Any idea?
> 
> Thanks,
> Eva
6 Sep 2015, 8:46 AM
#5
green_books avatar

green_books

New Zenner

Join Date:
Nov 2013
Location:
Hong Kong
Posts:
44
Plugin Contributions:
0

Re: HELP! Footer Disappear on Categories only

Hi Design 75,

Thanks for the advice, here is the log "myDEBUG-1441526578-683109.log":

[06-Sep-2015 13:37:08 Asia/Hong_Kong] PHP Fatal error:  1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and p.products_id = f.products_id and p.products_id = pd.products_id and p.produ' at line 5 :: select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                             from (products p
                             left join specials s on p.products_id = s.products_id
                             left join products_description pd on p.products_id = pd.products_id )
                             and p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '1' order by pd.products_name in /home/brightenbookscom/public_html/includes/classes/db/mysql/query_factory.php on line 120

Can't find any related solution yet.

Thanks,
Eva

Design75:

first of all you need to change the name of your admin folder, because you just made it public.

second, the log file entry you quoted is from the admin side, not the store front, so it has nothing to do with the disappearing footer. There are probably more log files. Find one that looks like myDEBUG-1440930163-99038.log, and not myDEBUG-adm-1440930163-99038.log
Also the quoted message is a warning, not a fatal error, which is also an indicator this is not the logfile you are looking for, because it does not resolve in a (partial) white page.

6 Sep 2015, 8:58 AM
#6
green_books avatar

green_books

New Zenner

Join Date:
Nov 2013
Location:
Hong Kong
Posts:
44
Plugin Contributions:
0

Re: HELP! Footer Disappear on Categories only

I tried to replace the query_factory.php with an old version, but this can't solve the problem.

And I saw something in here, someone said "... despite its mention in the error messages, query_factory.php is only mentioned because it is the part of the code that sends the query to the server. It is only the messenger."

6 Sep 2015, 9:02 AM
#7
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: HELP! Footer Disappear on Categories only

Database errors are hard to trace, unless you know where to find where the query was generated. I think it is time to install the myDEBUG Backtrace module first, this gives more info about the errors generated. It is very easy to install, only a few clearly marked lines of code.

6 Sep 2015, 9:33 AM
#8
green_books avatar

green_books

New Zenner

Join Date:
Nov 2013
Location:
Hong Kong
Posts:
44
Plugin Contributions:
0

Re: HELP! Footer Disappear on Categories only

Really thanks for the module, below is the new log, quite a lot of errors though :shocking:

[06-Sep-2015 17:27:45 Asia/Hong_Kong] #1  trigger_error() called at [/home/brightenbookscom/public_html/includes/classes/db/mysql/query_factory.php:120]
#2  queryFactory->show_error() called at [/home/brightenbookscom/public_html/includes/classes/db/mysql/query_factory.php:105]
#3  queryFactory->set_error() called at [/home/brightenbookscom/public_html/includes/classes/db/mysql/query_factory.php:272]
#4  queryFactory->ExecuteRandomMulti() called at [/home/brightenbookscom/public_html/includes/modules/elegancer_pink/specials_index.php:46]
#5  include(/home/brightenbookscom/public_html/includes/modules/elegancer_pink/specials_index.php) called at [/home/brightenbookscom/public_html/includes/templates/elegancer_pink/templates/tpl_modules_specials_default.php:12]
#6  require(/home/brightenbookscom/public_html/includes/templates/elegancer_pink/templates/tpl_modules_specials_default.php) called at [/home/brightenbookscom/public_html/includes/templates/elegancer_pink/templates/tpl_index_product_list.php:189]
#7  require(/home/brightenbookscom/public_html/includes/templates/elegancer_pink/templates/tpl_index_product_list.php) called at [/home/brightenbookscom/public_html/includes/modules/pages/index/main_template_vars.php:217]
#8  require(/home/brightenbookscom/public_html/includes/modules/pages/index/main_template_vars.php) called at [/home/brightenbookscom/public_html/includes/templates/elegancer_pink/common/tpl_main_page.php:121]
#9  require(/home/brightenbookscom/public_html/includes/templates/elegancer_pink/common/tpl_main_page.php) called at [/home/brightenbookscom/public_html/index.php:97]

[06-Sep-2015 17:27:45 Asia/Hong_Kong] PHP Fatal error:  1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and p.products_id = f.products_id and p.products_id = pd.products_id and p.produ' at line 5 :: select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                             from (products p
                             left join specials s on p.products_id = s.products_id
                             left join products_description pd on p.products_id = pd.products_id )
                             and p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '1' order by pd.products_name in /home/brightenbookscom/public_html/includes/classes/db/mysql/query_factory.php on line 120
6 Sep 2015, 4:20 PM
#9
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,080
Plugin Contributions:
56

Re: HELP! Footer Disappear on Categories only

It's not a lot of errors, it's just a lot of details! What the updated log is showing is what module called the query_factory with the invalid query that resulted in that log.

Working down from the top (the location where the error was discovered/logged), the query_factory class was ultiimately called by

#4  queryFactory->ExecuteRandomMulti() called at [/home/brightenbookscom/public_html/[B]includes/modules/elegancer_pink/specials_index.php[/B]:46] 

There's something in the query created by that module on or around line 46 that's causing the issue.

7 Sep 2015, 4:56 AM
#10
green_books avatar

green_books

New Zenner

Join Date:
Nov 2013
Location:
Hong Kong
Posts:
44
Plugin Contributions:
0

Re: HELP! Footer Disappear on Categories only

Thanks!!
It works now.

7 Sep 2015, 11:51 AM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: HELP! Footer Disappear on Categories only

Green Books:

Thanks!!
It works now.

Great, what had to be changed for it to work?