Skip to content
Snippets Groups Projects
Commit f64ec117 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[BUGFIX] styleguide: Have proper l10n_source field generator

With TCA changes from #104311, l10n_source in styleguide
is now configured as type=passthrough just like everywhere
else. This needs a bit attention in styleguide data generator
to create "int'ish" values, or postgres stumbles during
insert.

Resolves: #104327
Related: #104311
Releases: main
Change-Id: I1a95f64d5f0db06c2f72c063128fe607134f3429
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85145


Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 2bc51dd9
No related merge requests found
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Styleguide\TcaDataGenerator\FieldGenerator;
use TYPO3\CMS\Styleguide\TcaDataGenerator\FieldGeneratorInterface;
/**
* Generate data for l10n_source passthrough fields
*
* @internal
*/
final class TypePassthroughFieldL10nSource extends AbstractFieldGenerator implements FieldGeneratorInterface
{
protected $matchArray = [
'fieldName' => 'l10n_source',
'fieldConfig' => [
'config' => [
'type' => 'passthrough',
],
],
];
public function generate(array $data): string
{
// @todo: int would be better and more correct.
return '0';
}
}
......@@ -98,8 +98,11 @@ final class FieldGeneratorResolver
FieldGenerator\TypeNoneFormatDateTime::class,
FieldGenerator\TypeNone::class,
// l10n_source is type=passthrough but needs an int
FieldGenerator\TypePassthroughFieldL10nSource::class,
// General type=passthrough generator
FieldGenerator\TypePassthrough::class,
// General type=user generator
FieldGenerator\TypeUser::class,
// General type=uuid generator
......
......@@ -33,9 +33,6 @@ final class General extends AbstractTableHandler implements TableHandlerInterfac
{
/**
* Match always
*
* @param string $tableName
* @return bool
*/
public function match(string $tableName): bool
{
......@@ -44,8 +41,6 @@ final class General extends AbstractTableHandler implements TableHandlerInterfac
/**
* Adds rows
*
* @param string $tableName
*/
public function handle(string $tableName): void
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment