[TYPO3-core] RFC #13172: suggest wizard does not work properly with TCA field type "select"

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Jan 7 21:27:03 CET 2010


This is SVN patch request.

Type: Bugfix / Feature

Branches: 4.3, trunk

BT reference: http://bugs.typo3.org/view.php?id=13172

Problem:
In 4.3 the "suggest" wizard got implemented. The pending documentation 
says that this already should work for TCA field types "group" and 
"select". But there are quite some issues when using it for fields of 
type "select".

a) the wizard is only looking for table definitions to search for in the 
TCA config property "allowed" - but this configuration option is not 
part of the regular configuration for "select" fields - those use 
"foreign_table"

b) the JS part of this feature is not differentiating if the suggested 
item shall be added to a group field or a select field. In general, both 
get rendered as HTML-select fields, but internally the ID values of the 
selectable options differ. Group fields need the table name prepended to 
the uid (tt_content_2,tt_news_3,...) whereas select fields only need the 
uid. In general it's not a problem for TCEforms on saving, if the table 
name got prepended in "select" fields as well, the problem arises when 
you already have a item selected and accidentally try to add it a second 
time although multiple selections are not allowed. Due to the fact that 
currently the new item has the tablename prepended to its uid and the 
selected existing item hasn't, the TCEform-JS thinks these are two 
different items and is adding it a second time, which is wrong.


Solution: the patch ;)

a) add 'foreign_table' to the list of tables to search in
b) make the JS class that is handling the suggest-form aware of the TCA 
field type and let it deliver type specific well formatted option values 
to the TCEform-JS.


New feature:

In addition I added a new feature by allowing to define 
additionalSearchFields in the wizards configuration. By those you can 
tell the wizard in which db-fields besides of the label it should search 
for the search string (maybe if you like to search for keywords of your 
records etc.).


Would be nice if it could make it into 4.3.1 :)

-- 
kind regards,
Franz Koch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: suggest-wizard-selectFields_v2.diff
Type: text/x-diff
Size: 4744 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100107/365eba0e/attachment.diff>


More information about the TYPO3-team-core mailing list