Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294288

When setting `NotNull` constraint on type: required_label, two validation errors appear

$
0
0

Problem/Motivation

Ran into this while working on #3364109: [PP-2] Configuration schema & required values: add test coverage for `nullable: true` validation support.

#3341682: New config schema data type: `required_label` introduced type: required_label, and it looks like this:

required_label:
  type: label
  label: 'Label'
  constraints:
    NotBlank: {}

NotBlank has a $allowNull option that defaults to FALSE. In other words: it disallows bothNULLand the empty string ''.

Unfortunately, this means that any config property that is explicitly marked required by setting the NotNull constraint, this triggers a double error:

Steps to reproduce

See tests.

Proposed resolution

  1. Write tests.
  2. Adjust type: required_label to work fine both when NotNull is present and when it is absent.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A


Viewing all articles
Browse latest Browse all 294288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>