Follow-up from #1653026: [META] Use properly typed values in module configuration.

Problem/Motivation

All integers, Booleans, and even octal numbers in config object files are converted to strings.

Proposed resolution

#1653026: [META] Use properly typed values in module configuration has fixed core, so no need to convert all data types to string anymore.

Remaining tasks

Fix and issue patch for below config files:

action.settings.yml
views.view.test_bulk_form.yml

User interface changes

NO

API changes

NO

Parent: #1653026: [META] Use properly typed values in module configuration

Files: 
CommentFileSizeAuthor
#12 2105905-action-cofig-cleanup-12.patch4.67 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 59,373 pass(es).
[ View ]
#7 2105905-action-yml-type-casting-7.patch4.51 KBkrishnan.n
PASSED: [[SimpleTest]]: [MySQL] 59,368 pass(es).
[ View ]
#3 2105905-action-yml-type-casting-3.patch4.97 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 58,794 pass(es).
[ View ]
#3 2105905-diff-2-3.txt4.42 KBvijaycs85
#2 2105905-action-yml-type-casting-2.patch4.82 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 58,793 pass(es).
[ View ]

Comments

Title:Make sure all YML files in action module has no type-casting to string.Make sure all YML files in Action module has no type-casting to string.

Status:Active» Needs review
StatusFileSize
new4.82 KB
PASSED: [[SimpleTest]]: [MySQL] 58,793 pass(es).
[ View ]

Initial patch...

StatusFileSize
new4.42 KB
new4.97 KB
PASSED: [[SimpleTest]]: [MySQL] 58,794 pass(es).
[ View ]

changing int to bool...

+++ b/core/modules/action/tests/action_bulk_test/config/views.view.test_bulk_form.ymlundefined
@@ -22,35 +22,35 @@ display:
+          override: TRUE

In other patches you use lowercase for boolean statements.

Which should they be uppercase or lowercase. Pick one.

Uppercase.
EDIT: chx's point below trumps all other conventions.

lowercase. Bring the issue up with the symfony yaml guys. It dumps lowercase.

StatusFileSize
new4.51 KB
PASSED: [[SimpleTest]]: [MySQL] 59,368 pass(es).
[ View ]
new4.51 KB
PASSED: [[SimpleTest]]: [MySQL] 59,446 pass(es).
[ View ]

'0' => false, '1' => true. This is only for: config/views.view.test_bulk_form.yml. Will work thru the rest, if this is OK.

Please provide review feedback on the patch above, and i'll script through the rest of the tree -- thx.

Yes this looks good! Careful with scripting. Perhaps share the script with us? You can't wholesale search-replace 1 and 0 to true and false, sometimes they are numbers.

Script attached:

#!/bin/sed -f
# convert 0 to false and '1' to true, and also lower-case TRUE/FALSE
# Usage: boolconvert.sed <yml-file-name>
# searching for :<space><tab>(whole-word) '1' or '0'
# whole-word reason: we don't want to mess with '-1', 100, etc
# Bug: "token: 1 black sheep" will become "token: true black sheep"
s/:[   ]*'\<1\>'/: true/
s/:[   ]*'\<0\>'/: false/
s/:[    ]*\<0\>/: false/
s/:[    ]*\<1\>/: true/
s/:[    ]*FALSE/: false/
s/:[    ]*TRUE/: true/

Also, how best to walk through directory tree to pick up relevant yml files? This is the rough version:

# Pick up config files in ./modules/<module-name>/config/*.yml
#
find .  -name '*.yml' | grep "\/modules\/\<[a-z]*\>\/config\/.*yml\>"  | xargs sed -i -f ../boolconvert.sed

Better to do the above by hand?

Status:Needs review» Needs work

+++ b/core/modules/action/tests/action_bulk_test/config/views.view.test_bulk_form.yml
@@ -81,57 +81,57 @@ display:
-          group: '1'
...
+          group: true

Group should definitely be a number, this is the group used when the condition groups are built for the query. So 1 is the default group here.

Issue summary:View changes

updating views.view.test_bulk_form.yml

Issue summary:View changes
Status:Needs work» Needs review
StatusFileSize
new4.67 KB
PASSED: [[SimpleTest]]: [MySQL] 59,373 pass(es).
[ View ]

Re-roll...

Status:Needs review» Closed (duplicate)
Related issues:+#2167623: Add test for all default configuration to ensure schema exists and is correct

The patch on this issue has been updated as part of #2167623: Add test for all default configuration to ensure schema exists and is correct. As this issue doesn't have any test to confirm/validate the schema, making this change and closing this issue as duplicate of #2167623: Add test for all default configuration to ensure schema exists and is correct. The contributors of this issue (in commit message) is copied to #2167623: Add test for all default configuration to ensure schema exists and is correct.