[TYPO3-english] tx_table_db: transformWhere() typo3 core function fails?
Matyi Gábor
gmatyi at freemail.hu
Fri Dec 23 12:27:24 CET 2011
Hi guys!
I'm working on a tt_products based site where I'd like to list that products where the products title fields begins with character A,B,C,D. I modified the tt_products_list_view.php, but unfortunately I stucked into a trouble:
There is a "transformWhere" function within the typo3, that correct the table alias name, but it seems to be fails.
my where clause looks like so:
"AND (inStock > 0) AND SUBSTR(tt_products.title,1,1) REGEXP '([A-D])' AND SUBSTR(tt_products_cat.title,1,1) REGEXP '([A-Z])'"
and the tranformwhere covert it to
"AND(products.inStock > 0)AND SUBSTR(title,1,1)REGEXP '([A-D])' AND SUBSTR(tt_products_cat.title,1,1)REGEXP '([A-Z])'"
My question how to tell typo3 that the "tt_products.title" should be not changed to title?
The whole query looks like so, this fails, because als tt_products_cat has title fields.
[SELECT] => (string) DISTINCT products.uid uid,products.pid pid,products.category category,products.note note,products.note2 note2,products.price price,products.price2 price2,products.directcost directcost,products.graduated_price_uid graduated_price_uid,products.tax tax,products.inStock inStock,products.datasheet datasheet,products.unit_factor unit_factor,products.weight weight,products.image image,products.title title,products.bulkily bulkily,products.special_preparation special_preparation,products.additional additional
[FROM] => (string) tt_products products LEFT OUTER JOIN tt_products_cat tt_products_cat ON tt_products_cat.uid=products.category
[WHERE] => (string) products.pid IN (10) AND 1=1 AND (products.inStock > 0) AND SUBSTR(products.title,1,1) REGEXP '([A-D])' AND products.deleted=0 AND products.hidden=0 AND (products.starttime<=1324597850) AND (products.endtime=0 OR products.endtime>1324597850) AND products.fe_group IN (' ',0,-1)
[GROUPBY] => (string)
[ORDERBY] => (string) tt_products_cat.sorting,products.title
[LIMIT] => (int) 51
Thanks in advance.
Regards
Gabor Matyi
More information about the TYPO3-english
mailing list