[TYPO3-mvc] Having problems implementing a filter for a list like in the example sjr_offers

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Jul 26 10:55:07 CEST 2011


Hey Sebastian,

> Has anybody a hint for me, how to get a filter for a list working?
>
> Or any other examples?

what exactly is not working? Is the demand object passed to your 
controller action empty, or won't the repository deliver the filtered 
data sets? Your repository of course has to implement a special find 
method that can deal with the demand and create constraints based on the 
filter settings. Maybe you can share your code (controller action, 
repository method, and in doubt also the Fluid code) so that we can see 
where the problem might reside.

> Another problem, in the example has the function array_merge been used for
> merging the result from the query with the first element for the select box.
>
> But this also throws errors.
>
> $this->view->assign('organizations',
>    array_merge(
>      array(0 =>  'Alle Organisationen'),
>      $this->organizationRepository->findByStates($allowedStates)
>    )
> );

the reason for this is, that as of Extbase 1.3 the repository doesn't 
any longer return a array but a queryResultObject, and thus the 
array_merge fails. In order to get it working try adding ->toArray() 
after "findByStates(...)" (findByStates($allowedStates)->toArray()).

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list