Skip to content

Unterstützung für notice Attribut in Formularfeldern - #390

Merged
thorol merged 1 commit into
FriendsOfREDAXO:mainfrom
thorol:main
Jan 30, 2026
Merged

Unterstützung für notice Attribut in Formularfeldern#390
thorol merged 1 commit into
FriendsOfREDAXO:mainfrom
thorol:main

Conversation

@thorol

@thorol thorol commented Jan 25, 2026

Copy link
Copy Markdown
Contributor
  • Dauerhaft sichtbare Hilfetexte unter Feldern per notice-Attribut (Issue Unterstützung für notice Attribut in Formularfeldern #389).

  • Änderungen: notice-Property für Items/Elements, Attribute-Handler unterstützt notice, Parser gibt notice in Templates weiter, Default-Fragment rendert Hilfezeile unter dem Feld.

  • Verwendung: addTextField(..., ['label' => 'E-Mail', 'notice' => 'Wird für Antworten genutzt']) usw.

  • Tests/Check: UI-Check im Backend, Feld mit notice anlegen und Sichtkontrolle; ggf. Cache leeren.

image

Summary by CodeRabbit

Release Notes

  • New Features
    • Formulare unterstützen nun Hinweismeldungen (Notices) für einzelne Formularelemente. Diese können auf einfache Weise hinzugefügt werden und werden automatisch unterhalb der entsprechenden Eingabefelder angezeigt, um Benutzer mit zusätzlichen Informationen zu unterstützen.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Moin

Walkthrough

Die Änderungen implementieren eine neue notice-Attribute für MForm-Elemente. Das Feature ergänzt die DTO-Klassen um eine Notice-Eigenschaft, erweitert den Attribute-Handler zur Verarbeitung des neuen Attributs, propagiert den Notice-Wert durch den Parser zu den Element-Vorlagen und aktualisiert das Standard-Fragment zur Darstellung des Notice-Textes vor dem Schließen des Input-Wrappers.

Changes

Cohort / File(s) Zusammenfassung
DTO-Erweiterungen
lib/MForm/DTO/MFormElement.php, lib/MForm/DTO/MFormItem.php
Fügt notice String-Eigenschaft zu beiden DTOs hinzu. MFormElement erhält setNotice(), MFormItem erhält zusätzlich getNotice() und setNotice() als öffentliche Methoden.
Attribute-Verarbeitung
lib/MForm/Handler/MFormAttributeHandler.php
Registriert neuen "notice" Attribut-Typ im Switch-Statement und ruft setNotice() auf dem Item auf.
Parser-Propagation
lib/MForm/Parser/MFormParser.php
Propagiert Notice-Wert von Item zu Element über setNotice() in 8 verschiedenen Element-Generatoren (input, textarea, select, checkboxes, radios, media, link, custom-link).
Template-Rendering
fragments/mform/mform_default.php
Rendert Notice-Inhalte als Help-Block-Paragraph vor dem Schließen des Input-Wrappers, falls Notice gesetzt ist.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.06% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Der Titel beschreibt präzise die Hauptänderung: Unterstützung für ein notice-Attribut in Formularfeldern, das in allen geänderten Dateien konsistent implementiert wird.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thorol
thorol merged commit 7e9b861 into FriendsOfREDAXO:main Jan 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant