If this is your first visit, check our documentation. To post, register or login.
Forums / Bug Reports / [Fixed v1.5.1] PHP Error when no Record Company ID with Typefilter

[Fixed v1.5.1] PHP Error when no Record Company ID with Typefilter

Locked

Started by maac2 on 16 Jul 2012, 12:24 PM · Views: 3,481

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
16 Jul 2012, 12:24 PM
#1
maac2 avatar

maac2

New Zenner

Join Date:
Jan 2011
Posts:
70
Plugin Contributions:
0

[Fixed v1.5.1] PHP Error when no Record Company ID with Typefilter

1.5.0 (upgraded, not new install)
Add ons: Various order-total modules from swguy and some custom edits (mostly cosmetic)
SFTP, Official upgrade procedure.

Only posting as a bug because it deals with incorrect URLs differently to other index filters and produces a debug file. Sorry if these circumstances are not considered bugs.

The Record Company index_filter will return a PHP error if &record_company_id= is not included in the URL ie main_page=index&typefilter=record_company

Other index filters (eg main_page=index&typefilter=music_genre) will return the index page (specifically the index content without index css being recognised). Record company will return an error and the following debug content:

PHP Fatal error: 1054:Unknown column 'r.record_company_id' in 'field list' :: select distinct r.record_company_id as id, r.record_company_name as name
from products p, products_to_categories p2c, product_music_extra pme, record_company m
where p.products_status = 1
and pme.record_company_id = r.record_company_id
and p.products_id = p2c.products_id
and pme.products_id = p.products_id
and p2c.categories_id = '0'
order by r.record_company_name in /includes/classes/db/mysql/query_factory.php on line 101

I was able to 'fix' (posting here to see if there are any ramifications) this by editing line 192 in /includes/index_filters/record_company_filter.php
TABLE_RECORD_COMPANY . " m
to
TABLE_RECORD_COMPANY . " r

16 Jul 2012, 4:29 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: [Fixed v1.5.1] PHP Error when no Record Company ID with Typefilter

Good catch.
The fix is correct, and is included in v1.5.1.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.