This is a sub-issue of #1910624: [META] Introduce and complete configuration schemas in all of core.

Problem/motivation

#1866610: Introduce Kwalify-inspired schema format for configuration introduced the idea of config schema. The changelog leads to (hopefully extensive) documentation on the format at http://drupal.org/node/1905070. While there are little cleanups planned for the format overall, the current format is a result of months of back and forths, so it should be perfectly fine to apply it more widely to core.

Proposed solution

Create a configuration schema for file module.

Schema in place

Schema not yet in place
filter.settings.yml
filter.format.plain_text.yml

Files: 
CommentFileSizeAuthor
#16 1919174-diff-13-15.patch563 bytesmr.york
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion. View
#15 1919174-filter-schema-15_0.patch1.77 KBmr.york
PASSED: [[SimpleTest]]: [MySQL] 52,853 pass(es). View
#13 1919174-filter-schema-13.patch1.67 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,232 pass(es). View
#13 1919174-diff-9-13.txt1.53 KBvijaycs85
#9 1919174-filter-schema-9.patch1.59 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,253 pass(es). View
#9 1919174-diff-7-9.txt1.04 KBvijaycs85
#8 2013-02-21_215035.png9.46 KBvijaycs85
#7 1919174-filter-schema-7.patch1.27 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 50,806 pass(es). View
#7 1919174-diff-5-7.txt726 bytesvijaycs85
#5 1919174-filter-schema-5.patch1.25 KBvijaycs85
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View
#5 1919174-diff-3-5.txt704 bytesvijaycs85
#3 1919174-filter-schema-3.patch1.32 KBvijaycs85
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View
#3 1919174-diff-1-3.txt420 bytesvijaycs85
#1 1919174-filter-schema.patch1.32 KBvijaycs85
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View

Comments

vijaycs85’s picture

Status: Active » Needs review
FileSize
1.32 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View

Adding schema file...

Status: Needs review » Needs work

The last submitted patch, 1919174-filter-schema.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
420 bytes
1.32 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View

Fixing typo...

Status: Needs review » Needs work

The last submitted patch, 1919174-filter-schema-3.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
704 bytes
1.25 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View

Removing type def: filter

Status: Needs review » Needs work

The last submitted patch, 1919174-filter-schema-5.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
726 bytes
1.27 KB
PASSED: [[SimpleTest]]: [MySQL] 50,806 pass(es). View

Re-rolling with fixes.

vijaycs85’s picture

Status: Needs review » Needs work
FileSize
9.46 KB

In filter.format.full_html.yml

format: full_html
...
...
...
filters:
  filter_url:
    module: filter
    status: '1'
  filter_autop:
    module: filter
    status: '1'
  filter_htmlcorrector:
    module: filter
    status: '1'

In filter.format.php_code.yml

format: php_code
...
...
...
filters:
  php_code:
    module: php
    status: '1'
langcode: und

To update them in Schema file(filter.schama.yml):

filter.format.*:
  type: mapping
  label: 'Filter format'
...
...
...
    filters:
      type: sequence
      label: 'Filters'
      sequence:
        - type: format.filter.[%key]

Where as %key has been defined as

format.filter.filter_html_escape:
  type: filter
  label: 'Filter HTML'

format.filter.filter_url:
  type: filter
  label: 'Filter URL'

format.filter.filter_autop:
  type: filter
  label: 'Filter autotop'

format.filter.php_code:
  type: filter
  label: 'PHP filter'

and filter defined in system.data_types.schema.yml

# Filter with module and status.
filter:
  type: mapping
  label: 'Filter'
  mapping:
    module:
      type: string
      label: 'Module'
    status:
      type: boolean
      label: 'Status'

when visit admin/reports/config-inspector/filter.format.php_code/form, I' getting all filters defined, instead of just PHP's (i.e. php_code)

2013-02-21_215035.png

Am I doing anything wrong here?

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
1.04 KB
1.59 KB
PASSED: [[SimpleTest]]: [MySQL] 52,253 pass(es). View

Status: Needs review » Needs work
Issue tags: -Configuration system, -D8MI, -language-config, -Configuration schema

The last submitted patch, 1919174-filter-schema-9.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review

#9: 1919174-filter-schema-9.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Configuration system, +D8MI, +language-config, +Configuration schema

The last submitted patch, 1919174-filter-schema-9.patch, failed testing.

vijaycs85’s picture

FileSize
1.53 KB
1.67 KB
PASSED: [[SimpleTest]]: [MySQL] 52,232 pass(es). View

Re-rolling...

Gábor Hojtsy’s picture

Status: Needs work » Needs review

#9: 1919174-filter-schema-9.patch queued for re-testing.

mr.york’s picture

FileSize
1.77 KB
PASSED: [[SimpleTest]]: [MySQL] 52,853 pass(es). View

Added always_show_fallback_choice config option with the last patch.

mr.york’s picture

FileSize
563 bytes
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion. View

Interdiff.

mr.york’s picture

Issue tags: +SprintWeekend2013

Add #sprintweekend tag :).

Status: Needs review » Needs work

The last submitted patch, 1919174-diff-13-15.patch, failed testing.

AshishK-dupe’s picture

Status: Needs work » Reviewed & tested by the community

Ran the test on file and filter module and they seems clean. Also ran node test, found couple of failures but I don't think its related to this issue.

webchick’s picture

#16: 1919174-diff-13-15.patch queued for re-testing.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Yay! :D

disasm’s picture

Thanks for the patch review AshishK! You got a patch committed in less than a day with your review! Congrats!

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