Follow up for #1935022-16: Add a language selector on views and #44
Part of #1938580: [META] Make active config save format match the default yml file (order and quotes)

Problem/Motivation

The order in the yml file in the sites/default active config is different than the default core yml

Proposed resolution

Make the default yml use the same order as what saves the active config.
(Or make the active config save use the same order as the default, ... some order that makes sense and is repeatable, so that a diff is really a diff and not an artifact of save using a different format.)

Also, make other things the same (like use or not use of quotes).

Remaining tasks

(novice) get steps to reproduce from the original issue and copy/update them here.

User interface changes

No UI changes.

API changes

No API changes anticipated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Category: task » bug

Marking as bug because diffs in config will not be honest with the keys moving around I think.

YesCT’s picture

dawehner’s picture

Issue tags: +Novice, +Config novice
Make the default yml use the same order as what saves the active config.
(Or make the active config save use the same order as the default, ... some order that makes sense and is repeatable, so that a diff is really a diff and not an artifact of save using a different format.)

Also, make other things the same (like use or not use of quotes).

So basically the reason for that are the following two problems:

  • There are some crazy people out there which write views yml files by hand. I think that's okay for tests, but not actual default viesws.
  • Previously the order of config files were sorted, that's no longer the case

So the task a novice can do is to basically save all those views, and copy the stored yml file back to the modules folder.

derEremit’s picture

Assigned: Unassigned » derEremit
derEremit’s picture

Status: Active » Needs review
FileSize
18.36 KB

So the task a novice can do is to basically save all those views, and copy the stored yml file back to the modules folder.

saved, compared diff to see that no actual values have changed.
I also deleted UUID from exported file, as that made no sense to me to be included ???

gdd’s picture

Issue tags: -CMI +Configuration system

Status: Needs review » Needs work

The last submitted patch, drupal-1938570.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
FileSize
2.66 KB
18.36 KB

Looks good, we just don't want all of them turned on by default.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

dawehner’s picture

+1

webchick’s picture

Status: Reviewed & tested by the community » Fixed
+++ b/core/modules/views/config/views.settings.ymlundefined
@@ -11,12 +11,12 @@ ui:
-      where: 'above'
+      where: above

+++ b/core/modules/views/config/views.view.archive.ymlundefined
@@ -41,27 +37,27 @@ display:
-            override: true
+            override: '1'
...
-          specify_validation: 1
+          specify_validation: '1'

So we're un-quoting strings, quoting ints, and casting booleans to ints even though YAML supports boolean values?

Go home Symfony, you're drunk. :(

We should really open up a follow-up issue (if it doesn't already exist) to pursue a YAML parser that doesn't screw up our values this badly, and/or fix Symfony's parser upstream.

In the meantime, this is needed for sensical diffs, so...

Committed to 8.x. I'll push once testbot has caught up a bit.

vijaycs85’s picture

Un-quoting single word string is something yml does but we have code style standard to have quotes for all label/string that can get space

YesCT’s picture

damiankloip’s picture

Not sure aboutbthat follow up, Isn't this something that our configuration system is enforcing and not the yaml component?

YesCT’s picture

I think that is what will be sorted out in that issue.

If it is possible, that issue might turn into "fix config save so that int dont have quotes, or fix config save to know about types" or something like that.

sun’s picture

Thanks for improving those default config files!

Please note though:

All of these default config file synchronizations are cosmetic clean-ups only and do not have a technical impact.

I don't know who started this effort and for which reason, but whatever the reason is, I'd recommend to forget about it.

Gábor Hojtsy’s picture

Thanks @sun! The idea is/was, that when updates are made to these files in later commits, it is very well possible that people will take their Drupal generated config and submit in the patch. If we have inconsistently written shipped config all the time, then reviewing those pathces will be a headache. Think if your IDE would reorder methods/functions in whatever PHP code file you open based on some logic :) Would not it be better to aggree on one logic for contributor sanity in that case?

YesCT’s picture

@sun I guess I started it

I agree it's not something not of the highest priority. But I think if we dont make it match it will be confusing. (It did confuse me while reviewing the schema issues.)

It is also a nice place for people to dip their toes in the water, to get used to the idea that there is config, etc.

[edit: added:]

It also has let us find things that we actually do want to fix.

sun’s picture

Sure, OK, as long as the intention and ultimate purpose is truly limited to "diff/patch CX and contributor sanity", this is completely fine.

What I want and need to prevent is that anyone may take this effort further than that. For example, it is only a very small mind-step from this to the idea of comparing your active config against your default config. That will not work.

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

Anonymous’s picture

Issue summary: View changes

added link to meta