There are 4 cases in core, where the sequence type isn't specified for config schema elements of type "sequence". They were found while scanning them by potx in #2601370: [META] Parsing notices with Drupal 8 RC2.

core/modules/image/config/schema/image.schema.yml

image.effect.image_desaturate:
  type: sequence

core/modules/user/config/schema/user.schema.yml

search.plugin.user_search:
  type: sequence
  label: 'User search'

core/modules/views/config/schema/views.cache.schema.yml

views.cache.none:
  type: views_cache
  label: 'No caching'
  mapping:
    options:
      type: sequence
      label: 'Options'

views.cache.tag:
  type: views_cache
  label: 'Tag based caching'
  mapping:
    options:
      type: sequence
      label: 'Options'
CommentFileSizeAuthor
#8 2601594-8.patch1000 bytesherom
#6 2601594-test-only.patch423 bytesherom
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

herom created an issue. See original summary.

Gábor Hojtsy’s picture

Gábor Hojtsy’s picture

Title: Missing sequence types in config schemas. » Missing sequence types in config schemas
Priority: Normal » Major
Issue tags: +D8MI, +language-ui, +sprint
Gábor Hojtsy’s picture

I may have been mistaken when I said empty sequences are not allowed. I vaguely remember now that we used these to define lists that may never have elements (all their items are undefined type). Eg.

# Plugin \Drupal\node\Plugin\Search\NodeSearch
search.plugin.node_search:
  type: mapping
  label: 'Content search'
  mapping:
    rankings:
      type: sequence
      label: 'Content ranking'
      sequence:
        type: integer
        label: 'Influence'

vs.

search.plugin.user_search:
  type: sequence
  label: 'User search'

The sequence type would fall back on no item definition AKA undefined items, which will throw errors, if there are children of the list. This is indeed an awkward way of defining types that do not allow values, but there is no other way. There do not seem to be explicit tests for it in schema tests.

Also, not sure if all the listed items belong to this rule, the user and image ones do look like so. The views ones look likely as well.

Gábor Hojtsy’s picture

Title: Missing sequence types in config schemas » Empty sequence definitions should be supported
Project: Drupal core » Translation template extractor
Version: 8.0.x-dev » 7.x-3.x-dev
Component: configuration system » Code

So I think empty sequence should be supported in potx.

herom’s picture

Status: Active » Needs review
FileSize
423 bytes

This is a quick fix.
But let's try with a test-only patch first, see if it fails.

Status: Needs review » Needs work

The last submitted patch, 6: 2601594-test-only.patch, failed testing.

herom’s picture

Status: Needs work » Needs review
FileSize
1000 bytes

Great! Now, let's try a fix.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense to me.

  • herom committed f6f2a92 on 7.x-3.x
    Issue #2601594 by herom, Gábor Hojtsy: Empty sequence definitions should...
herom’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. Fixed.

Gábor Hojtsy’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

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