Open batlock666 opened 3 years ago
Smells like a bug. I think a test would be good to show this.
I just stumbled over the same:
Reading this until L324 https://github.com/plone/plone.app.registry/blob/3f3e69cfd3f8c5b2e16cca9a32b247176acf7f9b/plone/app/registry/exportimport/handler.py#L269 looks like defining a default value would always overwrite any existing values.
Also, slightly related: If you set your value to purge="False"
that will only have an effect if it is of type list
, tuple
, set
, frozenset
or dict
. All other values, e.g. Booleans or a string from a TextLine would be overwritten.
I have this in my
registry.xml
:This adds the record
ugent.development.foobar
to the registry, and gives it the default value-1
. Now I can modify this value in the registry to eg.123
. However, if I run the same profile again, the value in the registry is changed back to-1
. Is this normal? I would think that once a record is created, the default value is ignored.