apostrophecms / apostrophecms/apostrophe

3.8: server error log spam for required conditional fields

Open
#3,569 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
4.6k
Forks
650
Avg merge
19h 21m
Merged PRs (30d)
23

Description

## To Reproduce
Create a conditional required string field. On admin UI fill without satisfying the field condition. On save everything looks good but console error `required: required` with trace is thrown.

## Expected behavior
No server error logs.

## Details
The conditional required fields were fixed not long ago. It seems the schema back-end doesn't know about that yet - here is the exact responsible code https://github.com/apostrophecms/apostrophe/blob/main/modules/%40apostrophecms/schema/index.js#L103. I have tested only `string` type, but this might be as well the case for other types.

**Version of Node.js:** any

**Version of Apostrophe** 8.3.1

Contributor guide

Open the contributing guide

Research direction

Start at modules/@apostrophecms/schema/index.js around line 103, the responsible code identified in the issue. Reproduce a conditional required string field in the admin UI, save without satisfying its condition, and verify that no server error log is emitted. Check whether the behavior also applies to other field types mentioned in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.