[TYPO3] realurl problem with duplicated entries in uniqalias table

Tania Morales tania.morales at gmail.com
Wed Sep 10 22:55:44 CEST 2008


I have a problem when i try to create friendly urls for our users profile
page, sometimes the real name is empty so then we need to use the nick name:
mydomain.com/user-profile/name/john-smith
mydomain.com/user-profile/name/john-s

To acomplish that i have found that is possible to add a condition to the
"alias_field" option, and it works fine :
 'IF(LENGTH(TRIM(realname))>0,realname,nickname)'

But as "field_alias" in the data base is a varchar(30), is cutting the
condition when it is saved in the data base so this creates duplicated
entries for the same user url every time that the url is used:
'IF(LENGTH(TRIM(realname))>0,re'

As quick fix  i have changed the length manually to 255, so i don't get
duplicated entries anymore, but now there is a problem with the indexes -
they wont work with the new length of that field.

Is this a bug in realurl ??? or is there a way to fix it without changing
the length for field_alias manually. THANKS.

'postVarSets' => array(
            '_DEFAULT' => array(

                'name' => array(
                   array(
                        'GETvar' => 'my_extension[useruid]' ,
                         'lookUpTable' => array(
                                  'table' => 'fe_users',
                                  'id_field' => 'uid',
                                  'alias_field' =>
'IF(LENGTH(TRIM(realname))>0,realname,nickname)',
                                  'addWhereClause' => ' AND DELETED=0 ',
                                  'useUniqueCache' => 1,
                                  'useUniqueCache_conf' => array(
                                      'strtolower' => 1,
                                      'spaceCharacter' => '-',
                                  ),
                                  'autoUpdate' => 1,
                                  'expireDays' => 30,
                               ),

                        ),
                    ),
),


-- 
T at ni@


More information about the TYPO3-english mailing list