[TYPO3-english] wfqbe and rawquery and preProcessQueryStructure

Mauro Lorenzutti mauro.lorenzutti at webformat.com
Mon Aug 16 10:18:55 CEST 2010


Hi Cathy,

Il 13/08/2010 4.23, Cathy Stephens ha scritto:
> I got the preProcessQueryStructure hook to work as detailed in the
> manual using QBE to construct my query.
>
> But when I try it with a raw query, the empty fields are not stripped.
>   The query will work if I select the two fields but not if I leave one
> empty.    I know little about php but when I looked at the php around
> the hook area in class.tx_wfqbe_queryform_generator.php it appears
> that it is not set up to use with rawquery?  Is that correct?
>    

This hook is useful in QBE queries only, not in raw queries, sorry :-(

> If so, any thoughts how to work around this so I can get the empty
> query fields stripped out?
>    

You can work via typoscript / PHP:

SELECT * FROM table WHERE field1='###WFQBE_field1###' AND 
field2='###WFQBE_field2###'

can be modified as follows:

SELECT * FROM table WHERE field1='###WFQBE_field1###' ###WFQBE_field2###

and via typoscript you can do something like this:

[globalVar = GP:tx_wfqbe_pi1|field2 != ]
plugin.tx_wfqbe_pi1.customQuery.123 {
     field2 = TEXT
     field2.data = ###WFQBE_field2###
     field2.stdWrap.wrap = AND field2='|'
}
[end]

Not tested but it should work. In any case this is just an idea on how 
to customize you raw queries.

I hope this will help you.

Regards,
-- 

Mauro Lorenzutti

CTO / Software Architect
mauro.lorenzutti at webformat.com
Tel.   +39-0427-926.389

WEBFORMAT srl -- www.webformat.com
Via S. Francesco d'Assisi, 6 -- 20122 MILANO
Corte Europa, 12 - 33097 Spilimbergo (PORDENONE)

TYPO3 Certified Integrator



More information about the TYPO3-english mailing list