93828[TASK] Allow translated labels in TCA "color" elements
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oliver Klee +1
- Josua Vogel +1
- Jörg Bösche +1
-
Verified V +2 Done
- Christian Kuhn +2
- Oliver Klee +1
- Josua Vogel +1
- core-ci +1 CI
Issues 2
Files 6
- typo3/sysext/backend/Classes/Form/Element/ColorElement.php+16 −5
- typo3/sysext/backend/Tests/Functional/Fixtures/tx_scheduler_task_group.csvnew+3 −0
- typo3/sysext/backend/Tests/Functional/Form/Element/ColorElementTest.phpnew+234 −0
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_basic.php+3 −0
- typo3/sysext/styleguide/Configuration/page.tsconfig+8 −3
- typo3/sysext/styleguide/Resources/Private/Language/locallang.xlf+3 −0
Review log 1923
-
Garvin Hicking uploaded patch set 1 04/23/26, 12:44
-
core-ci voted on patch set 1 V +1 04/23/26, 12:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101039
-
Nikita Hovratov voted on patch set 1 CR +1 V +1 04/23/26, 13:03
-
Josua Vogel uploaded patch set 2
CR +1V +104/24/26, 07:48 -
Josua Vogel commented on patch set 2 04/24/26, 07:48
@garvin@hick.ing I added the following: A shared resolveColorLabel closure ensures consistent behavior: - Translatable labels (LLL:, domain syntax) are resolved via sL() - If sL() returns an empty string (e.g. invalid LLL reference), the raw color value is used as fallback instead of a broken label - null or empty labels gracefully fall back to the color value - Both palette and valuePicker labels use the same format: "Translated Label (#RRGGBB)" -
core-ci voted on patch set 2 V +1 04/24/26, 07:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101076
-
Josua Vogel voted on patch set 2 CR +1 V +1 04/24/26, 08:24
-
Benjamin Franzke voted on patch set 2 CR +1 V +1 04/24/26, 09:24
-
Oliver Klee voted on patch set 2 CR +1 04/24/26, 11:11
-
Garvin Hicking commented on patch set 2 04/24/26, 12:42
Thanks - tbh I'm not the biggest fan of inlineReply
I would rather like to have this as a protected method; that would allow testability, and I don't really like mixing "real" methods within methods - one reason why I prefer PHP over JavaScript ;-) Would that be fine with everyone who has voted? I do see benefit in streamling this, so thanks for the nudge. -
Josua Vogel commented on patch set 2 04/24/26, 12:48
Reply
Yes, that would be fine 😊 -
Benjamin Franzke commented on patch set 2 04/24/26, 13:02
Reply
well, on the other hand one could argue: protected (better say private) methods shall not be tested at all (they are implementation detail), only public ones ;) -
Garvin Hicking commented on patch set 2 CR -1 04/24/26, 13:28
on it -
Garvin Hicking uploaded patch set 3
CR +1V +104/24/26, 14:34 -
Garvin Hicking commented on patch set 3 04/24/26, 14:37
Reply
I implicitly read this as "So let's actually have a test" - so here we go 😊 The json encoded checks might be awkward, but I assumed we don't want to extract JSON out of HTML to decode it to match it to a readable array, and I think the assertions are "good enough". The only thing I see that's arguably a case, I had to add the `$this` context to the now non-static array_map enclosure. Hope that's fine for everyone like this. -
Garvin Hicking uploaded patch set 4 04/24/26, 14:38
-
core-ci voted on patch set 3 V +1 04/24/26, 14:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101094
-
core-ci voted on patch set 4 V +1 04/24/26, 14:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101095
-
Josua Vogel voted on patch set 4 CR +1 V +1 04/24/26, 14:47
-
Jörg Bösche voted on patch set 4 CR +1 04/28/26, 06:40
-
Oliver Klee voted on patch set 4 CR +1 V +1 04/28/26, 10:51
-
Christian Kuhn commented on patch set 4 CR +2 V +2 05/02/26, 15:59
Reply
thanks. i guess the $this context is fine in this case. -
Christian Kuhn merged patch set 5 05/02/26, 16:55