I installed the module manually and added the `Smart Range Field` field in my dev environment and it worked fine as expected then i tried to export the config from `admin/config/development/configuration/single/export` the files and its storage ex: (field.field.node.event.field_date.yml, field.storage.node.field_date) and added it as inside `test_module`module install folder and run it as part of unit testing ex : php ./core/scripts/run-tests.sh --verbose --suppress-deprecations --color --url 'http://local.com' --php "$(which php)" --class 'Drupal\Tests\test_module\Functional\Sampletest' it comes up with couple of schema errors

    Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for
    field.field.node.event.field_date with the following errors:
    field.field.node.event.field_date:default_value.0.default_date_type
    missing schema,
    field.field.node.event.field_date:default_value.0.default_date
    missing schema

When export the view modes and added it as part of install folder then i comes with error like.

    Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for
    core.entity_view_display.node.event.event with the following errors:
    core.entity_view_display.node.event.event:content.field_date.settings.format
    missing schema

So i believe this has to done with the schema setup.

Comments

santhosh.fernando created an issue. See original summary.

santhosh.fernando’s picture

Issue summary: View changes
mandclu’s picture

Title: Schema error on install » Schema error on unit test install
Assigned: Unassigned » mandclu

Can you post the exported config?

santhosh.fernando’s picture

This is a example of the file used to export the configs..

Fine Name: "field.field.node.testing_content_type.field_smart_date.yml"

langcode: en
status: true
dependencies:
  config:
    - field.storage.node.field_smart_date
    - node.type.testing_content_type
  module:
    - smart_date
id: node.testing_content_type.field_smart_date
field_name: field_smart_date
entity_type: node
bundle: testing_content_type
label: 'Smart date'
description: ''
required: false
translatable: false
default_value:
  -
    default_date_type: ''
    default_date: ''
    default_duration_increments: "30\r\n60|1 hour\r\n90\r\n120|2 hours\r\ncustom"
    default_duration: 60
default_value_callback: ''
settings: {  }
field_type: smartdate

The view display file `core.entity_view_display.node.testing_content_type.default.yml`

langcode: en
status: true
dependencies:
  config:
    - field.field.node.testing_content_type.body
    - field.field.node.testing_content_type.field_smart_date
    - node.type.testing_content_type
  module:
    - smart_date
    - text
    - user
id: node.testing_content_type.default
targetEntityType: node
bundle: testing_content_type
mode: default
content:
  body:
    label: hidden
    type: text_default
    weight: 101
    settings: {  }
    third_party_settings: {  }
    region: content
  field_smart_date:
    weight: 102
    label: above
    settings:
      timezone_override: ''
      format: default
      format_type: medium
    third_party_settings: {  }
    type: smartdate_default
    region: content
  links:
    weight: 100
    region: content
    settings: {  }
    third_party_settings: {  }
hidden:
  search_api_excerpt: true

I tested the logic with 'strictConfigSchema` is FALSE by default refer:Reference and it worked as expected so i believe this is something with the schema.

santhosh.fernando’s picture

I have update the schema `smart_date.schema.yml` to the following and it worked for me and i tested the same in unit test as well. Somebody can take a look at the same.

# Schema for the configuration files of the Smart Date module.

# smartdate field type.

field.storage_settings.smartdate:
  type: field.storage_settings.datetime
  label: 'Smart date settings'

field.field_settings.smartdate:
  type: field.field_settings.datetime
  label: 'Smart date settings'

field.value.smartdate:
  type: mapping
  label: 'Default value'
  mapping:
    default_time_type:
      type: string
      label: 'Default start time type'
    default_time:
      type: string
      label: 'Default start time value'
    default_end_time_type:
      type: string
      label: 'Default end time type'
    default_end_time:
      type: string
      label: 'Default end time value'
    default_duration:
      type: integer
      label: 'Default duration'
    default_duration_increments:
      type: string
      label: 'Duration options made available to the user'
    default_date_type:
      type: string
      label: 'Default start date type'
    default_date:
      type: string
      label: 'Default start date value'

field.formatter.settings.smartdate_default:
  type: field.formatter.settings.datetime_default
  label: 'Smart date default display format settings'
  mapping:
    separator:
      type: string
      label: 'Smart Date Format'
      translation context: 'Smart date separator'
    timezone_override:
      type: string
      label: 'Time zone override'
      translation context: 'Smart date separator'
    format:
      type: string
      label: 'Format'
      translation context: 'Smart date separator'
    format_type:
      type: string
      label: 'Format Type'
      translation context: 'Smart date separator'
field.formatter.settings.smartdate_plain:
  type: field.formatter.settings.datetime_plain
  label: 'Smart date plain display format settings'
  mapping:
    separator:
      type: label
      label: 'Separator'
      translation context: 'Smart date separator'

field.formatter.settings.smartdate_custom:
  type: field.formatter.settings.datetime_custom
  label: 'Smart date custom display format settings'
  mapping:
    separator:
      type: label
      label: 'Separator'
      translation context: 'Smart date separator'

field.widget.settings.smartdate_datelist:
  type: mapping
  label: 'Smart date select list display format settings'
  mapping:
    increment:
      type: integer
      label: 'Time increments'
    date_order:
      type: string
      label: 'Date part order'
    time_type:
      type: string
      label: 'Time type'

field.widget.settings.smartdate_default:
  type: mapping
  label: 'Smart date default display format settings'

smart_date.smart_date_format.*:
  type: config_entity
  label: 'Smart date format'
  mapping:
    id:
      type: string
      label: 'ID'
    label:
      type: label
      label: 'Label'
    date_format:
      type: string
      translatable: true
      form_element_class: \Drupal\config_translation\FormElement\DateFormat
      label: 'Date Format String'
      translation context: 'Smart date format'
    time_format:
      type: string
      translatable: true
      form_element_class: \Drupal\config_translation\FormElement\Textfield
      label: 'Time Format String'
      translation context: 'Smart date format'
    time_hour_format:
      type: string
      translatable: true
      form_element_class: \Drupal\config_translation\FormElement\Textfield
      label: 'Time Hour Format String'
      translation context: 'Smart date format'
    allday_label:
      type: string
      translatable: true
      form_element_class: \Drupal\config_translation\FormElement\Textfield
      label: 'All day label'
      translation context: 'Smart date format'
    allday_label:
      type: string
      translatable: true
      form_element_class: \Drupal\config_translation\FormElement\Textfield
      label: 'All day label'
      translation context: 'Smart date format'
    separator:
      type: string
      translatable: true
      form_element_class: \Drupal\config_translation\FormElement\Textfield
      label: 'Separator'
      translation context: 'Smart date format'
    join:
      type: string
      translatable: true
      form_element_class: \Drupal\config_translation\FormElement\Textfield
      label: 'Join'
      translation context: 'Smart date format'
    ampm_reduce:
      type: string
      translatable: true
      form_element_class: \Drupal\smart_date\FormElement\Boolean
      label: 'Reduce AM/PM display'
    date_first:
      type: string
      translatable: true
      form_element_class: \Drupal\smart_date\FormElement\Boolean
      label: 'Date First (if unchecked, will show time first)'
mandclu’s picture

Awesome, thanks for your work on this. Could you roll a patch?

santhosh.fernando’s picture

@mandclu due our policy we cant create a patch, It will be really helpful if somebody create a patch for this.

mandclu’s picture

Status: Needs work » Needs review
StatusFileSize
new1.9 KB

A patch is attached. If you can verify that it resolves the issue, I'll commit it.

santhosh.fernando’s picture

@mandclu that works as expected.. Thank you...

  • mandclu committed dec7a4b on 8.x-1.x
    Issue #3070723 by mandclu, santhosh.fernando: Schema error on unit test...
mandclu’s picture

Status: Needs review » Fixed

Thanks for your review, merging this in.

Status: Fixed » Closed (fixed)

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