Skip to content

[ENG-12678] Keep checkbox answers when editing a CEDAR record - #1109

Merged
brianjgeiger merged 1 commit into
CenterForOpenScience:feature/pbs-26-22from
sh-andriy:fix/ENG-12678-checkbox
Nov 25, 2026
Merged

brianjgeiger merged 1 commit into
CenterForOpenScience:feature/pbs-26-22from
sh-andriy:fix/ENG-12678-checkbox

Conversation

@sh-andriy

Copy link
Copy Markdown
Collaborator

Purpose

QA on test3 found that editing a published Human Cognitive Neuroscience Data record and saving it without changes turned it into a draft.

Since #1105 the edit form loads the saved answers with templateAndInstanceObject, so the CEDAR editor rebuilds its validity report. But cedar-embeddable-editor 1.5.0 doesn't load checkbox answers this way. This template's required "Preprocessing status" is a checkbox, so it came up empty, the record was saved as a draft and that answer was cleared. Loading with instanceObject keeps checkbox answers but doesn't rebuild the report, which is what #1105 fixed for the Selenium "Type" field.

Summary of Changes

  1. The metadata page CEDAR form loads the saved answers with templateAndInstanceObject and then again with instanceObject, so the report is rebuilt and checkbox answers are kept.
  2. The collection metadata step does the same.
  3. Updated unit tests.

Side Effects

None expected. A record with a required field left empty is still saved as a draft.

QA Notes

Human Cognitive Neuroscience Data is the only template with a checkbox field on test3 and prod.

  1. Open a published Human Cognitive Neuroscience Data record on a project or registration, click Edit and Publish without changes, it should stay published and "Preprocessing status" should keep its value.
  2. Click Edit, uncheck "Preprocessing status" and save, it should be saved as a draft.
  3. The [ENG-12678] Unable to submit a project to a collection after editing any section #1105 steps should still pass: on https://test3.osf.io/collections/selenium/add, "Click to edit" on Collection Metadata and save without changes, Add to Collection should go through, and Update on an accepted submission should keep its record published.

@brianjgeiger
brianjgeiger merged commit 124d171 into CenterForOpenScience:feature/pbs-26-22 Nov 25, 2026
3 checks passed
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