[TYPO3-project-formidable] Searchform not filtering data

Pablo Santamaría webdeportivo at yahoo.es
Wed Jul 29 19:17:11 CEST 2009


Hi!

I'm using Typo3 4.28 and Ameos Formidable 2.0.367.

I'm retrieving data from DB with a datasource:DB, then filtering it 
using a searchform and finally, showing it with a lister.

My problem is apparently the following: searchform doesn't not filter 
data retrieved, and the lister always show all possible rows. It seems 
that searchform's WHERE clause is not added to the original query from 
datasource:DB.

After performing some tests, I've found the following: When I insert 
inside the searchform a child with a name which not corresponds to any 
field on the database, only is showed a Mayday error when the original 
SQL query returns an empty result. When the original query returns data, 
searchform is ignored.

Any idea would greatly appreciated. Thanks in advance

Cheers,
Pablo.

Here I'm writing down the searchform and the query:

SEARCHFORM:
-----------

    <renderlet:SEARCHFORM name="srchf_pi4_select_competition" label="xxx">
       <datasource use="dtsrc_pi4_select_competition" />
          <childs>
             <renderlet:TEXT name="foo" label="xxx" >
             </renderlet:TEXT>

            <renderlet:SUBMIT name="search_button" label="xxx" 
mode="search" />
          </childs>
    </renderlet:SEARCHFORM>

QUERY
-----
return 'SELECT '
    . TX_SPORTSCOMPETMGMT_TABLE_COMPETITION.'.uid AS uid, '
    . TX_SPORTSCOMPETMGMT_TABLE_COMPETITION.'.name AS name, '
    . TX_SPORTSCOMPETMGMT_TABLE_SPORT.'.name AS competition_sport'
    .' FROM '
    . TX_SPORTSCOMPETMGMT_TABLE_COMPETITION.','
    . TX_SPORTSCOMPETMGMT_TABLE_SPORT
    .' WHERE '
    . TX_SPORTSCOMPETMGMT_TABLE_COMPETITION.'.sport = 
'.TX_SPORTSCOMPETMGMT_TABLE_SPORT.'.uid'
    .' AND '.TX_SPORTSCOMPETMGMT_TABLE_COMPETITION.'.pid="108"';

To make this query return an empty set, just change "pid=108" by pid !=108


More information about the TYPO3-project-formidable mailing list