[TYPO3-mvc] extbase SetOrderings doesn't work

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Jan 24 18:58:43 CET 2011


Hey Johannes,

> SELECT tx_psoabilling_domain_model_band.* FROM
> tx_psoabilling_domain_model_band WHERE tx_psoabilling_domain_model_band.year
> = '1' AND tx_psoabilling_domain_model_band.deleted=0 AND
> tx_psoabilling_domain_model_band.t3ver_state<=0 AND
> tx_psoabilling_domain_model_band.hidden=0 AND
> tx_psoabilling_domain_model_band.starttime<=1295881260 AND
> (tx_psoabilling_domain_model_band.endtime=0 OR
> tx_psoabilling_domain_model_band.endtime>1295881260) AND
> tx_psoabilling_domain_model_band.sys_language_uid IN (0,-1) AND
> tx_psoabilling_domain_model_band.pid IN (67) ORDER BY
> tx_psoabilling_domain_model_band.dateadded DESC

looks OK on first sight.

> I don't know how to write-down/copy the array of domain objects for you.
> Bute here is the beginning of my fluid-Template:
>
> <f:layout name="default" />
> <f:section name="main">
> <f:flashMessages />
>        <f:for each="{bands}" as="band">
>             <div class="psoabilling_list">
>               <div class="psoabilling_listitem">
> 	<div class="psoabilling_bandlogo">
>                     <f:if condition="{band.logo}!=">
>                       <f:then>

looks OK too.

> Ans so on. Maybe the "for each" isn't the right way?

no, that's fine. I assumed you might have used the pagination widget 
which could have messed with the orderings - but your template is 
probably one of the simplest usecases and is working just fine in general.

Have you tried calling the query from above directly on your database 
(or phpmyadmin) to see if the ordering applies correctly there? If 
that's the case it also has to work in extbase.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list