Join requests cannot be approved when any custom field is required; harden the join flow end to end #645
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
security
technical improvement
UX Improvement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
local-it/mitgliederverwaltung#645
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A club with required custom fields cannot approve any join request. Every approval fails with the generic flash "Failed to approve join request." Rejecting still works. Server log:
The values are present in the request's
form_data, keyed by custom field UUID and in a valid format (:date→"2026-03-21",:string→"Ordentlich").Root causes found so far
JoinFlow.build_member_attrs/1builds%{custom_field_id: key, value: to_string(value)}with atom keys and a bare string value.Member.Validations.RequiredCustomFields.extract_value_from_arg/2reads string keys ("custom_field_id","value"). Every provided value is lost, so every required custom field is reported missing. Present since approval was introduced (86d9242d).value_type. The join form stores boolean custom fields as"on"/"off", whichAsh.Type.Booleanrejects ({:error, "is invalid"}). The affected club has five optional boolean fields in its join form, including consent fields ("Datenschutzerklärung akzeptiert", "Zustimmung Satzung und Beitrag"). Once (1) is fixed, approval is expected to fail on these, and consent values must not be lost. Empty strings are passed through instead of being skipped.form_data. A request carries a value for a custom field that no longer exists (deleted after submission).build_member_attrs/1forwards every UUID-shaped key, so creating the custom field value for a deleted field will fail.join_form_field_required); here "Gewünschtes Beitrittsdatum" isrequired: truewhile its join description says "optional". Requests submitted without it can never be approved, and nothing warns the admin.JoinRequestLive.Showlogs the error but shows only a generic flash.Hardening: test the join flow thoroughly before building further features on it
Cover the full path public join form → submit → confirm → approve → member, through the real LiveView, not only the domain functions. At least:
"on"), unchecked ("off"or absent), and the resulting member value; consent fields must arrive on the member.requiredflag changed, type changed, custom field deleted.normal_user,own_data(approve refused cleanly).A property test over custom field type × submitted value (including
""and checkbox values) replaces hand-picked examples for the casting logic.Acceptance criteria
form_datacontains valid values for all required custom fields is approved, and the member carries those values with correct types.