#102159TCA Type Slug - Prefix user function additional parameters
Description
We would very much like to able to send addtional parameters to the prefix function. This is currently not possible.
‘config’ => [
‘type’ => ‘slug’,
‘appearance’ => [
‘prefix’ => SlugService::class . ‘>jobPrefix’,’,
‘parameters’ => [
‘foo’ => ‘bar’
]
],
‘generatorOptions’ => [
‘fields’ => [‘title’],
‘replacements’ => SlugUtility::REPLACEMENTS
],
‘fallbackCharacter’ => ‘
‘eval’ => ‘uniqueInSite’,
‘size’ => 60
]
In TcaSlug.php a solution to pass the provided parameters:
if ($prefix !== ‘’) {
//$parameters = [‘site’ => $site, ‘languageId’ => $languageId, ‘table’ => $table, ‘row’ => $row];
*$parameters = [
‘site’ => $site, ‘languageId’ => $languageId, ‘table’ => $table, ‘row’ => $row,
‘parameters’ => $fieldConfig[‘config’][‘appearance’][‘parameters’] ?? []
];*
$prefix = GeneralUtility::callUserFunction($prefix, $parameters, $this);
} elseif ($site instanceof SiteInterface) {
// default behaviour used for pages
$prefix = $this->getPrefixForSite($site, $languageId);
}
We believe this would be a welcomed extension of the Slug type for TCA.
Reviews 2
History 411
-
Henrik Jensen changed target version PHP Version 8.2 10/13/23, 08:51
-
Gerrit Code Review pushed patch set 1 for main to change 88829 status
NewUnder Review 03/28/25, 17:04 -
Gerrit Code Review pushed patch set 2 for main to change 88829 03/28/25, 17:18
-
Josua Vogel changed category 07/14/25, 18:26
-
Gerrit Code Review pushed patch set 1 for main to change 90157 07/25/25, 09:12
-
Gerrit Code Review pushed patch set 3 for main to change 88829 07/25/25, 09:12
-
Gerrit Code Review pushed patch set 4 for main to change 88829 02/24/26, 12:00
-
Gerrit Code Review pushed patch set 5 for main to change 88829 02/26/26, 19:33
-
Gerrit Code Review pushed patch set 6 for main to change 88829 02/26/26, 20:23
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % 02/27/26, 09:00 -
Benni Mack changed status
ResolvedClosed 03/31/26, 09:00
Applied in changeset commit:79dd24affad7f58254e844525c2f9db4304ed252.