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 some config schema coverage for system module, but it is not complete. 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
Figure out the missing pieces that are not yet covered. Write schema file sections for them. Clean up / fix any issues in current schema.
Schema in place
system.site.yml
system.maintenance.yml
Schema not yet in place
system.authorize.yml
system.cron.yml
system.date.yml
system.fast_404.yml
system.filter.yml
system.logging.yml
system.menu.yml
system.performance.yml
system.rss.yml
system.theme.yml
system.timezone.yml
Hold off on
system.module.yml
Comment | File | Size | Author |
---|---|---|---|
#46 | 1912250-config_schema_for_system-46.patch | 7.41 KB | adammalone |
#41 | 1912250-config_schema_for_system-41.patch | 7.61 KB | vijaycs85 |
#38 | 1912250-config_schema_for_system-38.patch | 7.02 KB | vijaycs85 |
#38 | 1912250-diff-32-38.txt | 1023 bytes | vijaycs85 |
#32 | 1912250-config_schema_for_system-32.patch | 6.99 KB | vijaycs85 |
Comments
Comment #0.0
gddUpdated issue summary.
Comment #1
adammaloneComment #2
adammaloneHere's a patch to complete a lot of the schema - unsure about correct kwalify syntax for some things so likely they'll need a look.
I've altered the key in system.authorize to allow_authorize_operations from allow_operations as everywhere else in core it appears to be allow_authorize_operations.
Comment #3
adammaloneevery time...
Comment #5
adammaloneLet's try with those datetimes expanded.
Comment #7
adammalone#5: 1912250-5-config_schema_for_system.patch queued for re-testing.
Comment #9
Gábor HojtsyShould not remove this empty line. Maybe add a
# Site settings
comment or something right before system.site. The current comment is more explaining the whole file section below, not the immediate schema piece.
Why are you changing this key? Given no change in any code files, it looks pretty dubious. Likely results in the installation failure.
Comment #10
Gábor HojtsyAlso, does not have anything to do with Views I believe. Remove VDC tag.
Comment #11
adammaloneSimilar to the user schema I'll have another go over this.
I changed the key as explained in #2
Do tell me if I'm wrong but it sure looks like the there was a mistake made when initially creating the config files:
Comment #12
adammalonereremoving tag
Comment #13
Gábor HojtsyGreat, good that you found this bug :) I guess we cannot really write tests for this since it is outside of the normal Drupal runtime.
Comment #14
vijaycs85Updating schema file syntax error.
Comment #16
vijaycs85Re-rolling for new schema file location...
Comment #17
Gábor Hojtsy- Application of single and double quotes is not consistent. May not be consistent either in existing schema either.
- Application of title casing and sentence casing is not consistent. Drupal uses sentence casing for form labels. So "Timezone Settings", "Date Format", etc. would be incorrect.
- Label uppercasing missing at some places, eg. "fast 404 enabled" and friends.
Cannot speak for the accuracy of the schema (yet), just looked at the patch.
Comment #18
vijaycs85Thanks for the review @Gábor Hojtsy.
As discussed with @alexpott on IRC:
1. No need to add quotes until there is no space in text (so mostly keys don't need quotes)
2. Always use single quotes.
Fixed them all as initcap.
Fixed
Comment #20
vijaycs85#18: 1912250-config_schema_for_system-18.patch queued for re-testing.
Comment #22
vijaycs85Comment #23
Gábor HojtsyOnly looked at code style, no time now to cross-check with data:
Add a dot at end of comment.
Types should not have quotes.
Two empty lines at the end of file instead of one?
Comment #24
vijaycs85Thanks for the quick review @Gábor Hojtsy. Here is the updated patch.
Comment #25
Gábor HojtsyThis looks good based on the code style (http://drupal.org/node/1905070#codestyle). It would be great if someone could help cross-check that the added schemas are correct. See http://drupal.org/node/1905070#debug for tips.
Comment #26
vijaycs85Removing 'allow_authorize_operation' as per #1926112: Remove allow_operations key from system.authorize.yml
Comment #27
alexpottThere is two definite errors in the schema...
This is not a string this is an array of enabled themes
This can be removed - see #1926112: Remove allow_operations key from system.authorize.yml
The other main issue is what should the value of the labels actually be... I think that we should be looking to reduce the number of new strings in Drupal and therefore I propose that the labels in the schema files should follow the #title values found in the administration forms as these labels are going to be used to generate forms!
One issue is with #title values / labels for booleans since these are often rendered as checkboxes and therefore have a full stop at the end. I've left them out here to be consistent with other labels - eg. the system.performance:js.preprocess label / title.
Another issue is with repetition... eg. the Fast 404 settings. The label
'Fast 404 enabled'
is within a mapping group labelled'Fast 404 settings'
. I think the label for the enabled key should be 'Enabled'. There is no UI for these settings.@Gabor please chime in before anyone doing any actual work on this.
Should be 'Compress CSS files'
Should be 'Time zone for new users'
Should be 'JavaScript performance settings'
Should be 'Compress JavaScript files.'
Maybe 'Page performance settings' or 'Response performance settings'?
I think this label should be 'Thresholds' we are already in 'Cron settings'
Should be 'Caching'
Should be 'Cache pages for anonymous users'
Should be 'Expiration of cached pages'
Should be 'Aggregate CSS files'
Should be 'Compress cached pages'
Maybe 'Delete stale JavaScript and CSS threshold'?
Maybe 'Force inline link rendering'?
Should be 'Feed description'
Should be 'Number of items in each feed'
Should be 'Feed content'
Should be 'Administration theme'
Should be 'Default time zone'
Should be 'Users may set their own time zone'
Should be 'Run cron every' to be consistent with cron settings form.
Should be 'First day of week' to be consistent with system config form.
Should be 'Default Long Date'
Should be 'Default Medium Date'
Should be 'Default Short Date'
should be 'Paths'
Should be 'Excluded paths'
Should be 'html'
Probably ought to be 'Allowed protocols' - this can't be configured in the interface and the config key probably has the wrong name because it is not very descriptive.
Should be 'Error messages to display'
Should be 'Aggregate JavaScript files.'
Should be 'Enabled'
Should be 'Remind users at login if their time zone is not set.'
Comment #28
Gábor HojtsyIndeed whenever there are form elements, the label values should follow those. The labels will indeed appear as translatable strings, since they will need to be used as part of a contrib translation form generator (based on our current config inspector).
As for the concrete suggestions, I believe Javascript is the right capitalization currently(?), also Timezone in one word, and shoud have no excessive capitalizations for the date formats.
Comment #29
alexpottMost of the labels were copied & pasted from our codebase :) ... including
Time zone
andJavaScript
.This isn't going to work... the user can create new date formats using admin/config/regional/date-time/formats
Comment #30
vijaycs85Fixed all (and made few upper/lower change in the suggestion).
Comment #31
Gábor HojtsyWell, well, if "Time zone" and "JavaScript" is on our UI/form text, then so be it :D
@vijaycs85: all lower case "javascript" is definitely overboard. If "JavaScript" is indeed used on the UI, then let's use that. Otherwise I think the current correct capitalization is "Javascript", but only apply that if there is not a pattern we can follow from our existing UI.
The date format type looks good to me. Let's add a dot after "# Date format with name, pattern" in the comment. (as per code style).
Comment #32
vijaycs851. Updating javascript/Javascript to JavaScript
2. Timezone/timezone to time zone
3. Date element comment fix in #31
Comment #33
alexpottThis is not a sequence... we need to use the %parent schema stuff here. My current active system.date.yml looks like this:
Comment #34
Gábor Hojtsy@alexpott: what would %parent serve here? Is the structure of all elements not the same? (In essence a sequence of date format items?) Seems to me like it is. The item types are not dependent on anything, all of the items in the list are the same type, no?
Comment #35
alexpottI'm wrong and @GaborHojtsy is correct... Date formats is a sequence. Sorry. Ignore #33
Comment #36
vijaycs85Still green and valid - Ready for review :)
Comment #37
Gábor HojtsySite slogan should also use label type, it is not multiline in core. Have not checked others, but this quickly shown up while testing config_translation module.
Comment #38
vijaycs85@Gábor Hojtsy thanks... fixed type change, few UI label mapping and comment format.
Comment #39
Gábor HojtsyThis issue seems to be duplicating some of #1922270: Label fix for system.site config schema? Sounds like that should be closed as a duplicate (and any good changes from there taken over to here, if not already).
Comment #40
Gábor HojtsyLooking at the patches in more detail, marked #1922270: Label fix for system.site config schema as duplicate. See notes below too.
Subject is a single line user edited free-form text field, so should use label, not text type.
Is this 'Name' a publicly visible human readable label? In that case it should be 'label'.
If these are exposed as editables on the UI, they should be label types. Not sure, dates have their own custom UI for this...
There are some changes in http://drupal.org/node/1922270 which should be carried over here. Eg. adding label for admin_compact_mode and weight_select_max and some of the paths. However, site slogan correctly uses label type here, whereas there it uses the text type incorrectly. So make sure to double check any changes carried over.
"Run cron every" sounds pretty hard to grasp. Is this seconds? Minutes? Hours?
Is this exposed on the UI ever? I don't think, but if it is, then it should likely be the text type.
Typo.
The feed description is exposed as a multiline free-form text field, so this should use the text type, not string.
Comment #41
vijaycs85Updating review comments in #40.
Reg
Just keeping the UI label consistency... We can create new issue, if it is worth changing in UI and schama.
Comment #42
Gábor HojtsyAll right, reviewed again, looks good :)
Comment #43
xjm#41: 1912250-config_schema_for_system-41.patch queued for re-testing.
Comment #45
Gábor HojtsyPatch did not apply, needs reroll.
Comment #46
adammaloneQuick reroll - wouldn't apply because of changes added #1947810: Some string/label types improperly assigned in configuration schemas
Comment #47
Gábor HojtsyLooks RTBC still :) Thanks for the reroll.
Comment #48
webchickCommitted and pushed to 8.x. Thanks!
Comment #49.0
(not verified) CreditAttribution: commentedUpdated issue summary.