[TYPO3-core] RFC: respect label_alt and label_alt_force at more places

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Jun 22 16:00:22 CEST 2006


This is a CVS patch request

Type:     Bugfix/Missing Feature?

Branches: HEAD and TYPO3_4-0

Issue:

A table in $TCA can have a 'label', 'label_alt' and 'label_alt_force'
settings [1], which configure a representative label for a single row in
this table. This is useful for example if you have fields "last_name"
and "first_name" but "last_name" alone isn't enough to represent the row
(e.g. "Müller" in Germany).

This is used in many places in the Core already, and the API to get this
done is t3lib_BEfunc::getRecordTitle(). But there are still some places
where this isn't being used.

Solution:

Calling the API to get the label instead of getting it from the field
'label' alone. Also we have to make sure we have the 'label' and
'label_alt' fields in the $row record before calling the API, else it
won't work.

Attached patch fixes the following places:

a) A field of type 'group' that points to a 'foreign_table'. In the
select-box only the 'label' of the pointed to records is displayed
(t3lib/class.t3lib_tceforms.php)

b) When adding more elements to such a 'group' field, the new labels
also doesn't respect the label_alt stuff (typo3/class.browse_links.php)

c) In Web>List, displaying a field that is configured as "MM" and points
to a table that has label_alt/label_alt_force settings.
(t3lib/class.t3lib_befunc.php). The patch also changes the separator
between record-labels from "," to ";", because a "," will be used to
separate a potential multi-field label_alt setting.

d) The patch also fixes the label generated by
t3lib/class.t3lib_loaddbgroup.php, which I thought was used in the
'group' field, but later found out that it wasn't. But I don't think it
will harm to have that fixed too.

How to test:

Easiest way is to add label_alt settings to existing tables. E.g.
install tt_news and add in exTables.php:

$GLOBALS['TCA']['tt_news_cat']['ctrl']['label_alt'] = 'description';
$GLOBALS['TCA']['tt_news_cat']['ctrl']['label_alt_force'] = TRUE;

Then add a news category with some description. Then add a news that
points to such a category and you can see a)b)c) in action (try with and
without the patch).


Cheers,
Ernesto


[1]
http://typo3.org/documentation/document-library/core-documentation/doc_core_api/current/view/4/2/#id2861852
-------------- next part --------------
A non-text attachment was scrubbed...
Name: label_alt.diff
Type: text/x-diff
Size: 4894 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060622/c681face/attachment.bin 


More information about the TYPO3-team-core mailing list