Document 5.4 features: PluralRules, EnumLabelTrait, FormHelper hidden, subcommand validation, enumOptions#8308
Open
dereuromark wants to merge 2 commits into
Open
Document 5.4 features: PluralRules, EnumLabelTrait, FormHelper hidden, subcommand validation, enumOptions#8308dereuromark wants to merge 2 commits into
dereuromark wants to merge 2 commits into
Conversation
… default, subcommand validation, enumOptions Adds docs and 5.4 migration guide entries for several 5.next merges: - PluralRules::setRule() / resetRules() for custom Gettext plural rules. - EnumLabelTrait + Label attribute for derived translated enum labels. - FormHelper now wraps hidden CSRF / FormProtection blocks with the HTML5 boolean hidden attribute instead of inline style display:none, so the default markup is strict-CSP compatible. - CLI rejects unknown positional tokens after a parent command that has sibling subcommands, surfacing typos instead of silently dropping them. - FormHelper::enumOptions() is now public for building select options from a backed enum without entity context.
Full detail is already on the linked Subcommand Validation section in the console-commands docs, so the migration guide just needs to flag the behavior change and point at it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents several merged 5.next features that were missing from the 5.4 migration guide and from the relevant chapters.
Primary target was the new
PluralRules::setRule()API (cakephp/cakephp PR 19454); while auditing the rest of the 5.next merge window I found four more gaps and bundled them in:PluralRules::setRule()/resetRules()— register a custom Gettext plural rule for a locale whose built-in form is missing or differs from the layout used by the app's .po/.mo files. New "Customizing Plural Rules" subsection in the i18n chapter + 5.4 migration entry.EnumLabelTrait+#[Label]attribute — defaultlabel()implementation that humanizes the case name and runs it through the translator, with per-case overrides via the new attribute. New subsection inorm/database-basics.mdnext toEnumLabelInterface+ 5.4 migration entry.FormHelperhidden default — wrapper around CSRF / FormProtection blocks now uses the HTML5 booleanhiddenattribute instead of inlinestyle="display:none;", so the default markup is strict-CSP compatible (nostyle-src 'unsafe-inline'). Updates the HTML output samples inviews/helpers/form.mdand adds an Added-in-5.4.0 note + a 5.4 migration entry covering selector compatibility for apps that styled the old wrapper.bin/cake i18n nonsensepreviously silently ran the parentI18nCommand; it now errors out with a list of available subcommands. New "Subcommand Validation" section inconsole-commands/commands.md+ 5.4 migration entry under Console behavior changes.FormHelper::enumOptions()made public — useful when the form is created without an entity context. Small example added to the Select Pickers section + 5.4 migration entry.Out of scope
The Lock component (cakephp/cakephp PR 19370) is being documented separately in docs PR 8272, so it is intentionally not touched here.
Some other 5.next merges already have open docs PRs in flight (8291 for
LoggedQuery::setRedactor(), 8305 forTable::findUnhydrated()), so they are likewise out of scope here.Notes
vitepress buildruns clean against the branch.#customizing-plural-rules,#enumlabeltrait-and-the-label-attribute,#subcommand-validation,#creating-select-pickers).