Per-Box-Colorpicker in RSCE-Listen unter Contao 5.7 defekt

Venne Media's Avatar

Venne Media

25 Jun, 2026 10:35 AM

Umgebung: Contao 5.7.7 · RSCE (madeyourday/contao-rocksolid-custom-elements) 2.4.15
Symptom: Ein Feld mit 'colorpicker' => true innerhalb eines list-Feldes wirft im Backend
Error: Missing target element 'button' for 'contao--color-picker' controller.
Derselbe Feldtyp auf Top-Level (außerhalb der Liste) funktioniert fehlerfrei.
Ursache:
• Contao 5.7 hat den Colorpicker neu als Stimulus-Controller implementiert (color-picker-controller.js, Pickr-basiert). Datei existiert erst ab 5.7 (in 5.4/5.5/5.6 → 404).
• Markup (DataContainer.php:622-742):
<div data-controller="contao--color-picker" data-contao--color-picker-theme-value="monolith">
• <input … data-contao--color-picker-target="input">
• <div data-contao--color-picker-target="button"></div>
• </div>
• 

• RSCEs Listen-JS be_main.js (removePicker/restorePicker) kennt nur den alten MooTools-Picker (new MooRainbow(...)). Beim Klonen der Dummy-Zeile fehlt im Klon das von Pickr bereits konsumierte data-contao--color-picker-target="button"-Element → Stimulus findet das Target nicht → Fehler.
• Gemeldet als offener RSCE-Bug: Issue #191 (gleiche Versionen, dem Maintainer zugewiesen, noch ohne Fix).

Die saubere Behebung liegt nicht im Template, sondern in RSCEs be_main.js: removePicker/restorePicker müssen zusätzlich zum MooRainbow-Pfad den Stimulus-Picker behandeln — d. h. vor dem Klonen/Reindizieren der Zeile sicherstellen, dass das [data-contao--color-picker-target="button"]-Element wiederhergestellt (bzw. Pickr-DOM bereinigt) ist und der contao--color-picker-Controller pro neuer Zeile sauber neu verbindet. Analog wurde das bereits für TinyMCE gelöst (isStimulus-Pfad in removeTinyMCEs/restoreTinyMCEs).

  1. Support Staff 1 Posted by RockSolid Theme... on 26 Jun, 2026 02:59 PM

    RockSolid Themes's Avatar

    Vielen Dank für Ihre Nachricht.

    Hierbei handelt es sich vermutlich um ein Problem in Contao bzw. dem verwendeten Color-Picker, weitere Details dazu finden sie im entsprechenden Ticket auf GitHub: https://github.com/madeyourday/contao-rocksolid-custom-elements/issues/191

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac