Project

General

Profile

Actions

Bug #16514

closed

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

Added by Ernesto Baschny over 17 years ago. Updated about 17 years ago.

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

0%

Estimated time:
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)


Files

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

Also available in: Atom PDF