Bug #16514

Respect label_alt setting in some more places (group with foreign_table's, etc)

Added by Ernesto Baschny about 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-08-31
Due date:
% Done:

0%

TYPO3 Version:
4.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

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).
(issue imported from #M4131)

label_alt-new.diff View (4.16 KB) Administrator Admin, 2006-08-31 12:42

History

#1 Updated by Ernesto Baschny about 13 years ago

This has already been approved by the core and I'm going to submit it to SVN now. This bug tracker entry is just to have a smaller entry in the ChangeLog and all details here.

#2 Updated by Ernesto Baschny about 13 years ago

Discussed in 22.6-6.7 in core-list. Approved then.

Just now commited to SVN in trunk and TYPO3-4-0.

#3 Updated by Ernesto Baschny about 13 years ago

Fixed in SVN (trunk and TYPO3-4.0).

Also available in: Atom PDF