Problem/Motivation

When an AI Disclosure grade that the grade map names is deleted, the settings form shows that row with nothing selected: the grade is no longer among the select's options, so it falls back to - None -. The next save of the form, for any reason, sends an empty grade for that row, and an empty row is dropped. The mapping is gone without the site builder being told, and creating the grade again with the same ID does not bring it back.

Found in the review of 1.0.0-alpha1. The empty select was measured; the dropped row follows from GradeMapTable::toConfig(), which skips a row without a grade (that is how the spare "add another" row is ignored).

Steps to reproduce

  1. Map a digitalSourceType to two grades on Configuration → Content authoring → Content credentials and save.
  2. Delete one of those grades in AI Disclosure.
  3. Open the settings form again: that row shows - None -.
  4. Change anything else, for example the read ceiling, and save: the row is gone from content_credentials.settings:grade_map.

Proposed resolution

Give such a row the missing grade as an extra option on that row only, labelled "id (no longer exists)" and selected, so a save keeps the row as it was. Recreating the grade makes it work again. Choosing - None - still removes the row on purpose. A new mapping cannot pick a missing grade.

Not in this issue: a status-report warning (a read that meets such a row is already logged), and removing rows when a grade is deleted (the settings are simple config and cannot depend on a grade).

Remaining tasks

  • Tests, then the fix.

User interface changes

On the settings form, a grade-map row whose grade was deleted shows "id (no longer exists)" instead of - None -.

Comments

maurice1969 created an issue. See original summary.

  • maurice1969 committed b4fa345c on 1.0.x
    Issue #3631647 by maurice1969: SPEC 034 — keep a grade-map row whose...

  • maurice1969 committed b4fa345c on main
    Issue #3631647 by maurice1969: SPEC 034 — keep a grade-map row whose...
maurice1969’s picture

Status: Active » Fixed

Committed to 1.0.x as b4fa345; CI green. A row whose grade no longer exists now shows "id (no longer exists)" and is saved as it was. It will be in 1.0.0-alpha2.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.