Respect label_alt setting in some more places (group with foreign_table's, etc)
A table in $TCA can have a 'label', 'label_alt' and 'label_alt_force'
settings , 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.
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
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
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)