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

Andreas Wolf typo3ml at andreaswolf.info
Sat Jul 18 12:04:30 CEST 2009


Hi Steffen,

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.

> 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.

> 3) No concern, but a bonus question :)
> Right now your feature delivers a pure search and select field. Adding
> new elements through this field by simply type and enter would be an
> awesome improvement. Of course this would only work under very limited
> circumstances (one single allowed field + one single source page with
> items). To get an idea what I mean, have a look at the tagpack extension.
> Of course this feature is far from being an improvement of this RFC and
> should be handled separately. But maybe we can prepare this patch to
> make it more easy to hook into the process to add this features later.
> I'm sorry for being so unprecise, but as already said it's a preliminary
> comment.

Ok, this is gonna be a bit more work. I think this won't make it into
4.4, but perhaps we can get it in with the new TCEforms I'm working on.
I hope to finish the missing parts at the end of July, perhaps until the
mid of August.

Cheers

Andreas



More information about the TYPO3-team-core mailing list