Skip to content

Dimension fields show stale choices in the editor field (survey responder view is OK) #919

@japsu

Description

@japsu

Symptom 1: Changes to choices are not shown in editor field

Steps to reproduce:

  1. Create a dimension with choices
  2. Create a dimension field that uses it
  3. Change choices in said dimension field
  4. Observe dimension field in editor
  5. Open form for responses
  6. Observe dimension field in form fill view

Expected results: Up-to-date choices

Actual results: Change done in 3 not shown in editor (4) but form fill view is up to date (6)

Symptom 2: Dimension field choices are shown in the language of the time of field creation

Steps to reproduce:

  1. Switch to English
  2. Create a dimension with choices in English only
  3. Create a language version in Finnish
  4. Create a dimension field using said dimension
  5. Observe English choices shown (by design)
  6. Add Finnish translations to choice titles

Ibid.

Speculation

When a new form field is saved that is of the dimension field types, its choices are not stripped away. This choices is just for show; ie. to reassure the user the field is working as is. It is created by injectChoices in the frontend.

The editor then shows these choices persisted at the time of creation.

The editor works on un-enriched (depleted?) fields. Enrichment, among other things, populates dimension choices, overriding the stale choices.

The form fill view, on the other hand, works on enriched fields. It will therefore get the always current choices.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

In Progress

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions