Skip to content

Add notice support in ParameterHandler for consistency - #392

Merged
skerbis merged 1 commit into
mainfrom
fix/notice-parameter-handler
Mar 10, 2026
Merged

Add notice support in ParameterHandler for consistency #392
skerbis merged 1 commit into
mainfrom
fix/notice-parameter-handler

Conversation

@isospin

@isospin isospin commented Feb 3, 2026

Copy link
Copy Markdown
Member

Problem

label and full work in the parameter array (e.g., for addMediaField), but notice does not.

Solution

Added notice case to MFormParameterHandler, same as label and full.

Example

This now works:

->addMediaField(1, ['label' => 'Image', 'notice' => 'min. 2800px width'])     

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

## Release Notes

* **Neue Funktionen**
* Verbessertes Formular-Handling für Benachrichtigungsparameter ermöglicht bessere Verwaltung von Mitteilungen in Formularen.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@coderabbitai

coderabbitai Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Moin

Walkthrough

Die Änderung erweitert den MFormParameterHandler um die Verarbeitung eines neuen Parameters namens "notice". Wenn dieser Parameter übergeben wird, ruft der Handler die Methode setNotice() auf dem entsprechenden Item auf. Das betrifft nur eine einzelne Datei mit minimalen Codeänderungen.

Changes

Cohort / File(s) Zusammenfassung
Parameter Handler für Notice
lib/MForm/Handler/MFormParameterHandler.php
Fügt Verarbeitung des neuen "notice"-Parameters hinzu, der setNotice() auf dem Item aufruft.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 Minuten

Possibly related PRs

Suggested reviewers

  • skerbis
  • joachimdoerr
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Der Titel beschreibt die Hauptänderung präzise: Hinzufügen von Notice-Unterstützung im ParameterHandler, was genau das Ziel des PR widerspiegelt.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/notice-parameter-handler

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the 'notice' parameter in MFormParameterHandler, enabling developers to pass 'notice' in parameter arrays alongside 'label' and 'full'. This fills a consistency gap where 'notice' was only supported in the attributes array but not in the parameters array.

Changes:

  • Added 'notice' case to MFormParameterHandler switch statement to call setNotice($value)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@skerbis

skerbis commented Mar 10, 2026

Copy link
Copy Markdown
Member

Vielen Dank für diesen PR und das schnelle Erkennen der fehlenden Lücke! 🙏

Wir haben die Änderung in einem eigenen Branch aufgegriffen und zusammen mit der vollständigen Erläuterung aus Issue #389 in PR #394 übernommen. Dort haben wir auch den Kontext der gesamten notice-Implementierung dokumentiert.

Bitte schau dir gerne #394 an – wir schließen diesen PR daher zugunsten des neuen. Nochmals danke für den Beitrag! 🎉

@skerbis
skerbis merged commit fe04d92 into main Mar 10, 2026
7 checks passed
@skerbis
skerbis deleted the fix/notice-parameter-handler branch March 10, 2026 22:26
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.

3 participants