[TYPO3-core] RFC #6872: Add suggest-like feature to TCEforms

Andreas Wolf typo3ml at andreaswolf.info
Wed Jul 22 19:42:31 CEST 2009


Hi Steffen,

Andreas Wolf schrieb:
> Steffen Müller schrieb:
>> 1) The ordering and limiting of items in the result list does not follow
>> _one_ strict rule. The final result list is in alphabetical order (the
>> sorting happens in t3lib_TCEforms_Suggest->processAjaxRequest). But this
>> ordering applies to a prelimited set of items, which themselves are
>> ordered by uid (sorting happens in
>> t3lib_TCEforms_Suggest_DefaultReceiver->queryTable).
>> Example: Imagine a result of 26 records:
>> uid=1, title=keyword Z
>> uid=2, title=keyword Y
>> ...
>> uid=26, title=keyword A
>>
>> Searching for 'keyword', the result list is: p,q,r,s,t,u,v,w,x,y,z
>> But I'd expect: a,b,c,d,e,f,g,h,i,j
>>
>> This can be confusing, since the alphabetical order suggests coherence.
> 
> you're right. The problem here is that no sorting is applied when
> selecting the records from the database table. I will add this
> possibility, ideally it should be configurable via TSconfig. The default
> implementation will use the label field, if defined. Otherwise sorting
> still happens via uid.
> 
> It is already possible to subclass the default receiver class and
> replace selectRecords(). You *could* implement your own sorting there,
> via exec_SELECTgetRows. But that's of course not ideal, so I'll
> implement a sorting feature.

I implemented exactly the described behaviour and attached a patch for it.

>> 2) I'd like to have an option to change maxItems. I have appended a
>> patch to add an option called maxItemsInResultList. The patch contains
>> only my changes.
> 
> I didn't look at it until now, but I'll have a look later on, maybe the
> next days.

I only tested that it applies correctly, but I did not check the
functionality by now. It should not do any harm, so I'm happy to have it
in. I'll also post a new patch on the list.

Regards,
Andreas

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0006872_tceforms-suggest-v7-custom-ordering.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090722/089fcbd9/attachment.txt 


More information about the TYPO3-team-core mailing list