Expected: If I have a model with a single-asset media field, and I edit the field to make either or both of the Title/Caption or Description child fields required, then all model records that do not meet this requirement will appear as invalid (as denoted by the red dot on the collection view under the content tab of that model type). Adding a value for the Title/Caption or Description should then let me Save and Publish the model. The record should then be valid.
Observed: When I add a value for the Title/Caption or Description field (whichever was required) I am (a) not able to either Save or Publish the record, and (b) the record still appears as invalid in the collection view.
Repro Steps:
- Make a new model
- Add a single-asset media field
- Create a record of that model. Add an image that lacks a Title/Caption and Description. Save and Publish the record.
- Edit the model’s media field to make Title/Caption required
- Return to the record you just created. Note that it’s invalid (and if you’ve got a working site with the
X-Exclude-Invalid
header set you will not get the record when you query Dato). - Edit the media field to add a value for the Title/Caption field
- Note that you are unable to Save and then Publish the record. Also note that the record still appears as invalid in the collections view. Also note that the record will not be returned for any queries you may have if you’ve got the
X-Exclude-Invalid
header set.
Workaround:
- After editing the Title/Caption and/or Description fields, click “Unpublish” on the record and then you will be able to re-publish it. Then the record will appear as valid in the collections view and it will be returned when querying the API.