Download & Extend

Label fix for system.site config schema

Project:Drupal core
Version:8.x-dev
Component:system.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)
Issue tags:Configuration schema, Configuration system, D8MI, language-config

Issue Summary

Few labels missing in system.site schema that found with the D8 configuration inspector sandbox module at http://drupal.org/sandbox/reyero/1635230

Comments

#1

Status:active» needs review

Adding patch and screenshot before and after fix

Before patch:
before-fix.png

After patch:
after-fix.png

AttachmentSizeStatusTest resultOperations
1922270-system-site-schema-labels-0.patch753 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 51,405 pass(es).View details | Re-test
after-fix.png20.04 KBIgnored: Check issue status.NoneNone
before-fix.png18.01 KBIgnored: Check issue status.NoneNone

#2

Status:needs review» needs work

Superb, let's add a label for the mapping too :) Otherwise looks good.

#3

Status:needs work» needs review

Thanks @Gábor Hojtsy for the quick review. Updating patch and after fix screenshot.

after-fix-2.png

AttachmentSizeStatusTest resultOperations
after-fix-2.png20.13 KBIgnored: Check issue status.NoneNone
1922270-system-site-schema-labels-3.patch1.25 KBIdlePASSED: [[SimpleTest]]: [MySQL] 51,352 pass(es).View details | Re-test
1922270-diff-1-3.txt827 bytesIgnored: Check issue status.NoneNone

#4

Please ignore patch in #3. It has code for some other fix. Adding right patch.

AttachmentSizeStatusTest resultOperations
1922270-system-site-schema-labels-4.patch827 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 51,352 pass(es).View details | Re-test

#5

Status:needs review» reviewed & tested by the community

Looks good. Completes missing system.site labels.

#6

Issue tags:+Configuration system

Tagging for config system too.

#7

Status:reviewed & tested by the community» needs work

Needs a reroll given that #1914366: Move all configuration schema files into a schema subdirectory landed.

#8

Re-rolling with schema file location change

AttachmentSizeStatusTest resultOperations
1922270-system-site-schema-labels-8.patch855 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 52,194 pass(es).View details | Re-test

#9

Status:needs work» needs review

#10

Status:needs review» reviewed & tested by the community

Still good :)

#11

Code style fixes... Ref: http://drupal.org/node/1905070#codestyle

AttachmentSizeStatusTest resultOperations
1922270-system-site-schema-labels-11.patch1.74 KBIdlePASSED: [[SimpleTest]]: [MySQL] 52,276 pass(es).View details | Re-test
1922270-diff-8-11.txt1.94 KBIgnored: Check issue status.NoneNone

#12

Status:reviewed & tested by the community» needs work

+++ b/core/modules/system/config/schema/system.schema.ymlundefined
@@ -1,39 +1,44 @@
-# Schema for configuration files of system module:
+# Schema for configuration files of system module.
system.site:

Missing newline between top level file comment and first section.

#13

Status:needs work» needs review

Updating space...

AttachmentSizeStatusTest resultOperations
1922270-system-site-schema-labels-13.patch1.74 KBIdlePASSED: [[SimpleTest]]: [MySQL] 52,219 pass(es).View details | Re-test
1922270-diff-11-13.txt395 bytesIgnored: Check issue status.NoneNone

#14

shall we add a mention of wanting a newline after the top level comment to http://drupal.org/node/1905070#codestyle ?

#15

Reviewing.
Todo the review, I'm following
http://drupal.org/node/1910624#comment-7088154
and
http://drupal.org/node/1910624#steps-to-test
along with
http://drupal.org/node/1905070#codestyle

side by side compare the data and schema .yml files

I did a side by side comparison manually, visually comparing the schema file and the two data files that the schema describes.
there are actually a lot of data .yml files in system, but the schema lists two: system.site and system.maintenance
(they looked fine)

Aside

Then, I thought I'd look at the form, but the form in the ui looks different than the schema says. Why is that?
side-by-side-and-form.png

back to review

there is a very small nit, to add the word "the" to the file comment. I'll reroll the patch for that.

In the mean time, I'm going to try http://drupal.org/project/config_inspector

AttachmentSizeStatusTest resultOperations
side-by-side-and-form.png680.18 KBIgnored: Check issue status.NoneNone

#16

name:
      label: 'Site name'
      type: label
    mail:
      label: 'Site mail'
      type: email
    slogan:
      label: 'Site slogan'
      type: text

I cannot remember what happened with the discussion of the different types:
label and text. site name is type: label, slogan is type: text.

#17

looking in http://drupal.org/node/1905070#types

it has a section:

# Simple extended data types:

# Human readable string that must be plain text and editable with a text field.
label:
  type: string
  label: 'Label'

# Internal Drupal path
path:
  type: string
  label: 'Path'

# Human readable string that can contain multiple lines of text or HTML.
text:
  type: string
  label: 'Text'

and defines the types: label, path, and text

#18

I got the inspector, and checked it there. Things look good and the form looks like @vijaycs85 saw in #3

My other questions here, don't need to hold up this patch, I was just writing them down and they can get answered later.

rtbc from me, but since I changed the code (the comment to match http://drupal.org/node/1905070#codestyle),
I'll wait for someone else to check that change and really rtbc it.

AttachmentSizeStatusTest resultOperations
1922270-system-site-schema-labels-18.patch1.75 KBIdlePASSED: [[SimpleTest]]: [MySQL] 52,261 pass(es).View details | Re-test
interdiff-13-18.txt426 bytesIgnored: Check issue status.NoneNone

#19

Status:needs review» needs work

Good find that the texts in the schema do not match the texts on the UI. Eg. "Front page path" vs. "Default front page" where the error paths were well labeled. Also some mismatch with the main item labels (name, slogan, email). It is suggested that the regular form labels are used for consistency.

#20

Where do the texts in the UI come from, if not from the system.site.yml or the schema ?
The grouping (mapping level) is a little different in the UI compared to the schema. But the schema and the system.site.yml grouping and mapping levels agree. That is puzzling.

#21

Yeah Drupal core will not use these files to generate forms, so comparing Drupal form structure to the schema file based forms is futile. As a general guideline however, it is best to reuse the Drupal form label text for schema item labels, so when contrib generates those translation forms, it looks as close as possible. Take views, we can generate a form for a view in contrib on one screen, but Views will obviously not expose one single form for editing a view.

#22

Updates:
1. replaced type label with string - IMO, we don't need this type as we are overriding label anyway.
2. Labels of fields from configuration page.
3. While searching label for compact admin_compact_mode, found a documentation issue #1928304: Update documentation of admin_compact_mode in system module
4. Adding dot "." for boolean labels.

Only local images are allowed.

AttachmentSizeStatusTest resultOperations
1922270-system-site-schema-labels-22.patch1.79 KBIdleFAILED: [[SimpleTest]]: [MySQL] 52,368 pass(es), 2 fail(s), and 0 exception(s).View details | Re-test
1922270-diff-18-22.txt1.35 KBIgnored: Check issue status.NoneNone

#23

Status:needs work» needs review

#24

Status:needs review» needs work

+++ b/core/modules/system/config/schema/system.schema.ymlundefined
@@ -1,39 +1,45 @@
-      label: "Put site into maintenance mode"
...
+      label: 'Put site into maintenance mode.'

why add the period there?

no-period-maintenance.png

Since it's not in the UI, I say leave it out.

AttachmentSizeStatusTest resultOperations
no-period-maintenance.png200.23 KBIgnored: Check issue status.NoneNone

#25

Status:needs work» needs review

Updating as per #24

AttachmentSizeStatusTest resultOperations
1922270-system-site-schema-labels-25.patch1.77 KBIdlePASSED: [[SimpleTest]]: [MySQL] 52,253 pass(es).View details | Re-test
1922270-diff-22-25.txt980 bytesIgnored: Check issue status.NoneNone

#26

Status:needs review» needs work

The last submitted patch, 1922270-system-site-schema-labels-25.patch, failed testing.

#27

Status:needs work» needs review

#25: 1922270-system-site-schema-labels-25.patch queued for re-testing.

#28

Status:needs review» needs work

Looks good, only found these two issues:

+++ b/core/modules/system/config/schema/system.schema.ymlundefined
@@ -1,39 +1,45 @@
+# Schema for the configuration files of the system module.
+

We capitalize module names elsewhere, no? :)

+++ b/core/modules/system/config/schema/system.schema.ymlundefined
@@ -1,39 +1,45 @@
+    slogan:
+      label: 'Slogan'
+      type: string

Site slogan is a single line text field. The string type should be used for internal strings like machine names, etc. Exposed textual settings should either use the label type (one line string) or the text type (multiline). The slogan is an exposed free textual setting using a one line input, so it should use type label.

#29

Status:needs work» closed (duplicate)

Marked as duplicate of #1912250: Complete configuration schemas for system module, the System module capitalization and the slogan type is correct there. I did not cross-check other changes, please do :)