The .info file that comes with the starter kit is nicely laid out and ver readable. However when you export from omega tool, all of this formatting is lost and the resulting file is very difficult to read. It would be great if the export functionality could format things a little morte like the starter kit file, grouping related items and adding comments.

Comments

Assigned:Unassigned» himerus

I'll take a quick look and see if there's any chance of getting something applied here.

Question here in regards to this "cleanup"... Are you referring to a subtheme created by Omega Tools? And the fact that it has no comments/spacing there?

Otherwise, when using Omega Tools to EXPORT modified theme settings, all that is dumped is the settings[] array, which is (even in the starterkit(s)) only the variables placed one line after another, with no commenting.

@himerus

I think the request is to make the exported .info file.

Because the $info array is not sorted in any specific order, it is possible to export the .info file, run a diff against the version of the .info file in your repository, and get that impression that a lot has changed in your theme's configuration even if you just changed one setting.

This is because, without sorting the info array in function omega_tools_build_info_file(), changing one value in the array will result in a file with a diff that looks like much more has changed.

I've attached a patch here that outputs the values with single string values at the top, but then sorts the rest of the output, when building the .info file.

This way, if you change only one setting in your theme, the diff will show "+" one line and "-" one line.

For example, assuming I've already saved and exported my default settings once. Let's say I change my theme's config simply to stop displaying my debugging blocks by default and to stop showing the grid overlay by default.

Then my diff, after re-exporting my settings and comparing it against the previous revision, would look like this:

@@ -41,9 +41,9 @@ settings[alpha_css][omega-forms.css] = 'omega-forms.css'
settings[alpha_css][omega-menu.css] = 'omega-menu.css'
settings[alpha_css][omega-text.css] = 'omega-text.css'
settings[alpha_css][omega-visuals.css] = 'omega-visuals.css'
-settings[alpha_debug_block_active] = '1'
+settings[alpha_debug_block_active] = '0'
settings[alpha_debug_block_toggle] = '1'
-settings[alpha_debug_grid_active] = '1'
+settings[alpha_debug_grid_active] = '0'
settings[alpha_debug_grid_roles][1] = '1'
settings[alpha_debug_grid_roles][2] = '2'
settings[alpha_debug_grid_roles][3] = '3'

Patch from #3 with whitespace removed.

Status:Active» Needs review

Status:Needs review» Reviewed & tested by the community

Can we get this committed please? Was this already fixed for the 4.x branch?

Yes, this is fixed in Omega 4.x... Omega Tools itself won't have any of this code in the 4.x branch because we moved the drush integration to the theme layer. However, that also means that currently Omega Tools does not provide this feature through the UI. I am not convinced yet that we actually need it via the UI but if we ever come to the conclusion that, although we already have it for drush, we still need it on the UI I will implement it on the 4.x branch of Omega Tools as well.

Note: The functionality for this got changed completely... We no longer rewrite the entire .info file but only replace the settings part of it. That means we no longer touch the formatting anyways.

Yes, this is fixed in Omega 4.x... Omega Tools itself won't have any of this code in the 4.x branch because we moved the drush integration to the theme layer. However, that also means that currently Omega Tools does not provide this feature through the UI. I am not convinced yet that we actually need it via the UI but if we ever come to the conclusion that, although we already have it for drush, we still need it on the UI I will implement it on the 4.x branch of Omega Tools as well.

Note: The functionality for this got changed completely... We no longer rewrite the entire .info file but only replace the settings part of it. That means we no longer touch the formatting anyways.

Status:Reviewed & tested by the community» Needs review
StatusFileSize
new1.25 KB

A tiny fix - the patch from #4 would move core attributes that had no values, e.g. 'description', to the top of the settings area, rather than keeping it with the rest of the core attributes.