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

Michael Stucki michael at typo3.org
Fri Sep 1 01:13:05 CEST 2006


Hi Ernesto,

you already committed this change, but still I thought it may be good to
have a closer look at it...

Again, I am quite unsure if things like this really qualify as bugs. Anyway,
here are two small notes:

- Please use implode() instead of the join() function
- You have changed the implode character in t3lib_beFunc from ',' to ';'
  I would have let this as it is and use ';' for imploding $MMfields. Seems
  more consistent regarding the $TCA "types" configuration directive...

Could you please change that?

Regards, michael

Ernesto Baschny [cron IT] wrote:

> 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

-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/



More information about the TYPO3-team-core mailing list