Problem

#111715: Convert node/content types into configuration just landed, so we need to do the config schema for it.

Files: 
CommentFileSizeAuthor
#11 2029405-schame-node_type-11.patch1.78 KBYesCT
PASSED: [[SimpleTest]]: [MySQL] 57,020 pass(es). View
#11 interdiff-9-11.txt492 bytesYesCT
#9 2029405-schame-node_type-9.patch1.82 KBYesCT
PASSED: [[SimpleTest]]: [MySQL] 57,059 pass(es). View
#9 interdiff-4-9.txt1.08 KBYesCT
#8 s01-overview.png1.18 MBYesCT
#8 s02_help.png104.66 KBYesCT
#8 s03-preview-notboolean.png109.24 KBYesCT
#8 s04-preview-disabled.png182.25 KBYesCT
#8 s05-preview-required-disabled.png197.11 KBYesCT
#8 s06-submitted-by.png412.84 KBYesCT
#8 s07-language-elsewhere.png74.8 KBYesCT
#7 s08-menu.png95.82 KBYesCT
#4 2029405-schame-node_type-4.patch1.73 KBrahul.shinde
PASSED: [[SimpleTest]]: [MySQL] 56,485 pass(es). View
#4 2029405-diff-1-4.txt800 bytesrahul.shinde
#2 node.type_.article.schama.form_.png90.34 KBvijaycs85
#1 2029405-schame-node_type-1.patch1.73 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 57,942 pass(es). View

Comments

vijaycs85’s picture

Status: Active » Needs review
FileSize
1.73 KB
PASSED: [[SimpleTest]]: [MySQL] 57,942 pass(es). View

Initial patch...

vijaycs85’s picture

form from config_inspector...

johnheaven’s picture

I've had a look over this and am not sure I understand correctly how the schema files work, so here a summary and a couple of examples of the things I found and if I'm right I'll post the rest of them in more detail:

  • I can't see the label "Content type" on the content type edit form (line 13 of node.schema.yml)
  • Line 18: should it be uuid and not uid ?
  • Is the file structured according to how the edit form is structured, or according to the structure of the data? help (line 27) and title_label (line 33) are under "Submission form settings" in the edit form, but are elsewhere in node.schema.yml
  • Comment Settings and Menu Settings are completely missing - is that correct?

As I say, there are a few other things I found but wanted to make sure I understand this correctly before reporting stuff!

rahul.shinde’s picture

FileSize
800 bytes
1.73 KB
PASSED: [[SimpleTest]]: [MySQL] 56,485 pass(es). View

While testing out the node schema, found configuration issue for with "Content type settings", Schema say the value for following fields,

  • Published
  • Promoted to front page
  • Sticky at top of lists
  • Create new revision

should be a boolean, but actually it saving values as a string, code snippet is as below,

      status: status
      promote: promote
      sticky: sticky
      revision: revision

I have update patch from comment number 1, which changes the type from boolean to string.

Attached are updated patch and the short summary what I have updated.

vijaycs85’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for working on this @rahul.shinde. Can see that you have created separate issue #2031131: Configuration saving issue with "Content type settings". for the format issue. IMHO, we need to push this as it is blocking other follow ups in config_translation module (e.g. #2029407: Add support for node types )

YesCT’s picture

+++ b/core/modules/node/config/schema/node.schema.ymlundefined
@@ -7,3 +7,68 @@ node.settings:
+    status:
+      type: boolean
+      label: 'Status'

This is an enabled/disabled status on the (config) entity.

See
ConfigEntityListController

and
ConfigEntityBase

  /**
   * The enabled/disabled status of the configuration entity.
   *
   * @var bool
   */
  public $status = TRUE;
YesCT’s picture

FileSize
95.82 KB

re #3 @johnheaven

Comment Settings and Menu Settings are completely missing - is that correct?

menu links, are content, and not configuration... so that is stored in the database.

wait, that's the default, that would be used when a actual article was created...

so, where is that stored?

s08-menu.png

is it like language.settings.yml?

$ cat menu.settings.yml 
main_links: main
secondary_links: account
override_parent_selector: '0'

nah, that would say something about article

YesCT’s picture

Assigned: Unassigned » YesCT
Status: Reviewed & tested by the community » Needs work
FileSize
74.8 KB
412.84 KB
197.11 KB
182.25 KB
109.24 KB
104.66 KB
1.18 MB

So, I looked at this closely.

first is some screenshots and notes so that I can remember what I was thinking later.
Patch attached for changes that I think need to be made.

Notes

s01

s01-overview.png

s02

s02_help.png

+++ b/core/modules/node/config/schema/node.schema.ymlundefined
@@ -7,3 +7,68 @@ node.settings:
+    help:
+      type: text
+      label: 'Explanation or submission guidelines'

label is fine,
but why is the config thing called "help"?
Maybe we used to call this help text.
Not the problem of this issue.

preview s03

s03-preview-notboolean.png

preview s04 disabled

s04-preview-disabled.png

preview s05 required

s05-preview-required-disabled.png

So.. it's not boolean. And is being saved with numbers 0, 1, 2 to represent the select I think.
Changed this to be integer.

but feels weird, maybe should be saving as string: optional, disabled, required? (not the problem of this issue.)

s06 status (show submitted by status)

s06-submitted-by.png

Changed the label in the schema to better match the label in the UI.

again, weird naming in saving the config, submitted sounds like is it submitted or not, not if it is displaying the submitted by authoring info. (not the problem of this issue)

s07 just noting that the language settings are saved elsewhere, language.settings.yml. ok.

s07-language-elsewhere.png

Changes

uid:
to
uuid:

preview type to int

better label on submitted

Also,

better label on status, the config entity status. See #6 (it's the purple note in the s01 overview screenshot).
A concern though, is that this is "status" in many config entities, so if this is a good idea, should change the label in those other schemas also. (would be a separate issue to change the other places)

--

patch coming.

YesCT’s picture

Assigned: YesCT » Unassigned
Status: Needs work » Needs review
FileSize
1.08 KB
1.82 KB
PASSED: [[SimpleTest]]: [MySQL] 57,059 pass(es). View

patch for the changes from #8.

vijaycs85’s picture

Thanks for working on this @YesCT. Improvements in #9 looks good.

one minor note:

+++ b/core/modules/node/config/schema/node.schema.ymlundefined
@@ -41,7 +41,7 @@ node.type.*:
-      label: 'Status'
+      label: 'Enabled status of the configuration entity'

it doesn't sound right. Status is the flag to say whether it is enabled/disabled. We can rename it something, but this property is there in all config and entityConfig. So we might need to all?

YesCT’s picture

FileSize
492 bytes
1.78 KB
PASSED: [[SimpleTest]]: [MySQL] 57,020 pass(es). View

yeah, I was just being persnickety.
We dont want to change it everywhere as part of this patch, and it's really not our problem here what it's named.

I put it back.
So I think this should be ok now.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +blocker

The settings structure seems to be confusing indeed, but that is how it is and schemas merely describe the status quo. This also blocks the config translation module support for node types, so adding the blocker tag.

Gábor Hojtsy’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed dc2304f and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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

Gábor Hojtsy’s picture

Issue tags: -sprint

Removing sprint tag.