Skip to content

some fixes. - #4

Merged
plicease merged 3 commits into
masterfrom
graham/fixes
Sep 24, 2026
Merged

plicease merged 3 commits into
masterfrom
graham/fixes

Conversation

@plicease

Copy link
Copy Markdown
Member

No description provided.

plicease and others added 3 commits September 23, 2026 21:42
A Submit or Button element with a value but no name triggered
"Use of uninitialized value $root in hash element" on every submitted
form, because Button sets force_default(1) and Field::process_input
passed the undefined nested_name to set_nested_hash_value.

The string renderers for Select, Textarea, Checkboxgroup (and so
Radiogroup) and ContentButton also emitted name="" with a sprintf
warning when the field had no name, and Date built sub-field names
from the undefined parent name. They now omit the name attribute,
matching the existing behaviour of the Input role.

The name() setter also accepts undef without a pattern-match warning.

Adds t/elements/unnamed_fields.t which traps warnings while processing
and rendering a form containing each affected element type.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…RT#45409)

A constraint such as

    when: { field: some_checkbox, values: [x], not: 1 }

was skipped whenever the checkbox was unchecked, because an unchecked
checkbox submits nothing and _process_when returned false for a
missing field before consulting 'not'. Users had to set
default_empty_value on the checkbox to make 'not' work.

A missing field's undefined value is now treated as not matching, in
both the value-list and truthiness checks. With 'not' set that fulfils
the condition and the constraint is applied. Without 'not' a missing
'field' still skips the constraint as before.

Behaviour change: with 'fields', a missing field was previously
silently ignored and the remaining fields decided the outcome. It now
counts as not passing, matching the documented "all named fields'
values pass" semantics.

Documents the missing-field rule under field, fields and not, and adds
t/constraints/constraint_when_not_missing_field.t covering field,
fields and any_field, with and without not.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@plicease
plicease merged commit 45d8797 into master Sep 24, 2026
42 checks passed
@plicease
plicease deleted the graham/fixes branch September 24, 2026 12:01
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