computerminds / cm_config_tools

DEPRECATED: Mirror of http://cgit.drupalcode.org/cm_config_tools
1 stars 0 forks source link

Only strip root UUIDs? #15

Open anotherjames opened 7 years ago

anotherjames commented 7 years ago

Investigate whether UUIDs sprinkled throughout a config could be ignored (like in image styles but potentially other config things too, where not actually used as UUIDs and therefore needs to exist) or not (as currently).

anotherjames commented 7 years ago

Image fields have a uuid property under 'default_image'.

anotherjames commented 7 years ago

Interesting realisation... the normalizeConfig() method that currently strips UUIDs came from config_update, which is concerned with diffing but not exporting. Config_devel's equivalent code, for exporting, only stripped the root UUID.

I think what we need is for normalizeConfig to have two 'modes', well or perhaps better, its calling code should simulate the latter: diffing and exporting. On diffing, always strip UUIDs (even in image style effects, since if everything else is the same, it's the same). On exporting, only strip the root UUID. That could have the effect of UUIDs changing unnecessarily when something else changes in the config, but that's ok. (A follow-up issue could even ensure sub-levels within config don't get exported if they haven't changed!)

darthsteven commented 7 years ago

An approach might be just to move to only stripping at the root level, and then see how many false positives we get with diffing, and then see if there's even a need for not diffing UUIDs.

anotherjames commented 7 years ago

For reference: pathauto patterns also use UUIDs similarly to image styles, for each selection criteria. But they don't explode on visiting their edit forms without them, so I don't believe they need adding to the existing special casing of image styles. (Regardless of whether the special casing all gets replaced by work for this issue.)

anotherjames commented 7 years ago

Entity browsers' widgets need UUIDs like this too, and can't be updated in the UI without them.

anotherjames commented 7 years ago

Default values in file fields expect UUIDs - they are handled correctly without them, but you do get notices about them when updating the field, e.g. via the content translation configuration page.

anotherjames commented 6 years ago

Imageapi_optimize processors need their UUIDs too in order to be editable in the UI.