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 user 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
user.mail.yml
user.settings.yml
user.flood.yml
user roles

Schema not yet in place

Files: 
CommentFileSizeAuthor
#13 1912258-config_schema_for_user-13.patch4.82 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,569 pass(es). View
#13 1912258-diff-11-13.txt497 bytesvijaycs85
#11 1912258-config_schema_for_user-11.patch4.73 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,231 pass(es). View
#11 1912258-diff-9-11.txt808 bytesvijaycs85
#9 1912258-config_schema_for_user-9.patch4.63 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,229 pass(es). View
#9 1912258-diff-7-9.txt2.88 KBvijaycs85
#7 1912258-config_schema_for_user-7.patch4.63 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 52,206 pass(es). View
#3 1912258-3-config_schema_for_user.patch914 bytestyphonius
PASSED: [[SimpleTest]]: [MySQL] 49,941 pass(es). View
#1 1912258-1-config_schema_for_user.patch1.14 KBtyphonius
PASSED: [[SimpleTest]]: [MySQL] 49,976 pass(es). View

Comments

typhonius’s picture

FileSize
1.14 KB
PASSED: [[SimpleTest]]: [MySQL] 49,976 pass(es). View

Here's a patch that adds in the additional schemas.

typhonius’s picture

Status: Active » Needs review
typhonius’s picture

FileSize
914 bytes
PASSED: [[SimpleTest]]: [MySQL] 49,941 pass(es). View

Actually... this patch would adhere more to kwalify formats since user roles should be user.role.*

Gábor Hojtsy’s picture

Gábor Hojtsy’s picture

Status: Needs review » Needs work
+++ b/core/modules/user/config/user.schema.ymlundefined
@@ -73,3 +73,33 @@ user.settings:
+  mapping:
+    "id": "Role ID"
+    "label": "Role Label"

No type on these?

Also are these the actual labels on the UI? Title cased? Drupal does not usually use title cased naming on the UI. Same true for the other part added (as well as the header "User Roles").

typhonius’s picture

Assigned: Unassigned » typhonius

I'll have another go over these. I wasn't aware that the label/id had to be linked to that in the UI.

vijaycs85’s picture

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

Adding additional schemas with code style fixes.

guy_schneerson’s picture

Status: Needs review » Needs work

Removed - not applicable

vijaycs85’s picture

FileSize
2.88 KB
4.63 KB
PASSED: [[SimpleTest]]: [MySQL] 52,229 pass(es). View

error: core/modules/user/config/user.schema.yml: No such file or directory

doesn't sound like patch in #7.

Fixed few labels as per UI.

guy_schneerson’s picture

Sorry vijaycs85 you are right, I removed #8 and Tested your latest patch in #9 and found only two small Issues:

  1. register uses an "enum" key and as far as I know we have no support for enumerations at this point and the configuration form should handle it. I think all thats needed is to remove the enum line
  2. register_pending_approval_admin is missing in the "user.mail:" section
vijaycs85’s picture

Status: Needs work » Needs review
FileSize
808 bytes
4.73 KB
PASSED: [[SimpleTest]]: [MySQL] 52,231 pass(es). View

Thank you @guy_schneerson. Updated patch to accommodate changes mentioned in #10. Good catch :)

guy_schneerson’s picture

Status: Needs review » Needs work

Great job @vijaycs85, the interdiff makes it real easy to review.

Not sure if I missed it before or if it was added recently but we are also missing password_strength from the user.settings.yml (this was recently added to allow disabling of the password strength indicator) and is a boolean.

Sorry if i missed it before - setting status to "needs a tiny bit more work :)"

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
497 bytes
4.82 KB
PASSED: [[SimpleTest]]: [MySQL] 52,569 pass(es). View

Thanks again @guy_schneerson. added password_strength.

guy_schneerson’s picture

Status: Needs review » Reviewed & tested by the community

Looks great @vijaycs85

  • Patch applied cleanly
  • All settings are accounted for and are of the correct type in the user.schema.yml
  • The configuration inspector tool produces forms with all settings and labels

Also updated the issue description and moved moved user.flood.yml & user roles into the "Schema in place" section as you have implemented those.

Not sure if anyone else needs to review but setting it to "Reviewed & tested by the community" so sett it back if you think it needs more review.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.