TYPO3 9.5:TCA 类型 'slug' 总是将“-1”添加到 URL
TYPO3 9.5: TCA type 'slug' always adds '-1' to URL
我的 extbase TCA 配置中有以下配置:
'path_segment' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'Path Segment',
'config' => [
'type' => 'slug',
'generatorOptions' => [
'fields' => ['productname'],
'replacements' => [
'/' => '-',
'.' => '',
'®' => '',
',' => '',
'|' => '',
' ' => '-',
],
],
'fallbackCharacter' => '-',
'eval' => 'unique'
]
),
当我保存时,我得到 URLs -1
添加到 URL (f.e.g "myproduct-1" 而不是 "myproduct")
我只能在编辑记录时点击列表模块中标有"Recalculate URL Segment from page title"的图标才能避免这种情况。
我们的编辑不太在意这个字段,每次保存记录时都会更改 URL。
我该怎么做才能自动完成此 "recalculation"?或者我在配置中做错了什么?
我正在使用 TYPO 3 9.5.17。
您应该更新到 9.5.18。此行为是回归:
2020-05-14 ccd6da5027 [BUGFIX] Exclude current record when checking slug's uniqueness (thanks to Xavier Perseguers)
我的 extbase TCA 配置中有以下配置:
'path_segment' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'Path Segment',
'config' => [
'type' => 'slug',
'generatorOptions' => [
'fields' => ['productname'],
'replacements' => [
'/' => '-',
'.' => '',
'®' => '',
',' => '',
'|' => '',
' ' => '-',
],
],
'fallbackCharacter' => '-',
'eval' => 'unique'
]
),
当我保存时,我得到 URLs -1
添加到 URL (f.e.g "myproduct-1" 而不是 "myproduct")
我只能在编辑记录时点击列表模块中标有"Recalculate URL Segment from page title"的图标才能避免这种情况。
我们的编辑不太在意这个字段,每次保存记录时都会更改 URL。 我该怎么做才能自动完成此 "recalculation"?或者我在配置中做错了什么? 我正在使用 TYPO 3 9.5.17。
您应该更新到 9.5.18。此行为是回归:
2020-05-14 ccd6da5027 [BUGFIX] Exclude current record when checking slug's uniqueness (thanks to Xavier Perseguers)