Skip to content

Transition to answers part 6 - #14645

Open
sebastienhoorens wants to merge 26 commits into
masterfrom
custom-field-answer-write-flip
Open

Transition to answers part 6#14645
sebastienhoorens wants to merge 26 commits into
masterfrom
custom-field-answer-write-flip

Conversation

@sebastienhoorens

Copy link
Copy Markdown
Contributor

Changelog

For translators

sebastienhoorens and others added 26 commits August 19, 2026 11:43
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The exporting controllers preload the answers of their records, or of
their records' authors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The auto insights matrix passes the answerable records themselves,
rather than plucking their custom_field_values along.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keys stored with an explicit null value now count as unanswered for
permission requirements and onboarding completeness.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Part 4 accidentally overwrote the factory that the answers table
introduced, losing its custom field association.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The domicile export contexts stay on custom_field_values: built-in user
fields read through their store accessors, which are hash-backed until
the hash retires.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Answer values remain searchable, while the internal field keys no
longer match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extracting goto_page_id retired the previous worst offender.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The JSON-schema validation of user custom_field_values moves from a
model validation to UserService.upsert_in_web_api, the only place where
it could actually trigger. The schemas themselves move from
CustomFieldService's metaprogrammed methods into the input type
strategies, composed by the new CustomFieldValuesValidationService.
The invites xlsx processor now casts cell values through the strategies
instead of interpreting the JSON schema.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The *_to_ui_schema_field methods call base_ui_schema_field, which is
defined nowhere, so any call would raise. handle_description no longer
has callers either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Publishing an input (create or update) now validates its
custom_field_values against the field schemas, like the registration
boundary does for users. Draft saves stay unvalidated, and user field
values merged into the input (u_-prefixed keys) are skipped. The update
action's params massaging moves into prepare_update_params to keep the
method within size limits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Preload the options for the registration field schemas, remove the dead
CustomFieldService#pages, inline the one-caller custom_field_keys, and
restructure the validation service spec around a let_it_be field pool.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The custom field answers become the source of truth. Writes stage
answers in-memory (CustomFieldValuesTransitionService at the ingestion
boundaries, persisted by the record's save through autosave), reads and
the API's custom_field_values output derive from the answers, and the
jsonb column stays only as an untouched backup (ignored_columns). The
sync mechanism is gone, the built-in demographics accessors are
answer-backed and code-resolved, and nil-containing values are now
rejected by a model validation on the answers. Specs follow separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Option and field deletion keep only their answers SQL, the null-values
check becomes a CustomFieldAnswer validation (dropping the checker's
User special case), and file destruction removes the referencing
answers. Templates and project copies serialize CustomFieldAnswer
records with answerable and custom_field refs — answers of fields
outside the template (registration fields in project copies) are not
copied, following the usual unresolvable-ref filtering. The
deserializer still accepts the custom_field_values of older template
files. The bulk and decidim importers and the seeds stage answers, and
the sync backfill task is deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The custom_field_answer factory resolves its field from the key, specs
build answers instead of assigning custom_field_values hashes (with the
parent field passed explicitly for _other and _follow_up companions),
and boundary specs call the transition service explicitly. Also fixes
update_merging_custom_fields! for attribute-less calls, found by the
specs. Covers the models, the survey generators and the first service
specs; the remaining buckets follow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cl-dev-bot

Copy link
Copy Markdown
Collaborator
Warnings
⚠️

The changelog is empty. What should I put in the changelog?

⚠️ The PR title contains no Jira issue key (case-sensitive)
⚠️ The branch name contains no Jira issue key (case-sensitive)
Messages
📖

Run the e2e tests

📖 Check translation progress

Generated by 🚫 dangerJS against 9962307

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.

2 participants