Project

General

Profile

Bug #99529

Updated by Sybille Peters over 1 year ago

Here, there is a collision with uid=4 and uid=5 as well as uid=4 and uid=6. They all have the slug 'hallo-2' which would be ok if the language differs, but sys_language_uid=-1 means the record will be shown for all languages 

 <pre> 
 select uid,sys_language_uid,deleted,hidden,slug,title from db.tx_sypetsexampleslug_something; 
 +-----+------------------+---------+--------+-------------------+---------------------+ 
 | uid | sys_language_uid | deleted | hidden | slug                | title                 | 
 +-----+------------------+---------+--------+-------------------+---------------------+ 
 |     1 |                  0 |         0 |        0 | hallo               | hallo                 | 
 |     2 |                  0 |         0 |        0 | halloeoe-usw-blah | hallöö usw. blah      | 
 |     3 |                  0 |         0 |        0 | hallo-1             | hallo                 | 
 |     4 |                 -1 |         0 |        0 | hallo-2             | hallo                 | 
 |     5 |                  6 |         0 |        0 | hallo-2             | hallo                 | 
 |     6 |                  0 |         0 |        0 | hallo-2             | hallo                 | 
 +-----+------------------+---------+--------+-------------------+---------------------+ 

 </pre> 


 h2. Reproduce 

 There is a minimal extension to reproduce issue which works with v12: https://github.com/sypets/sypets_example_slug 

 1. Use an extension with slug field (e.g. calendarize or "sypets_example_slug":https://github.com/sypets/sypets_example_slug) 
 2. Create several records with the same slugs (e.g. use same title if title is used). Create at least one record with sys_language_uid=-1 

 h2. Versions 

 * reproduced with latest main branch (v12) 
 * can be reproduced with v11 using EXT:calendarize, see issue: https://github.com/lochmueller/calendarize/issues/731 


 h2. Source code example 

 <pre><code class="php"> 
 // slug field 
         'slug' => [ 
             'exclude' => false, 
             'label' => 'slug', 
             'config' => [ 
                 'type' => 'slug', 
                 'generatorOptions' => [ 
                     'fields' => ['title'], 
                     'fieldSeparator' => '/', 
                     'prefixParentPageSlug' => true, 
                     'replacements' => [ 
                         '/' => '', 
                     ], 
                 ], 
                 'fallbackCharacter' => '-', 
                 'eval' => 'unique', 
                 'default' => '' 
             ] 
         ], 
 </code></pre> 

Back