I have Drupal8 site where client suddenly wanted to change some field from 2 decimal scale to 3. To X.XXX that is.

Now I'm aware that changing field definition when there's stuff in db is not possible. However I have been previously able to change decimal scale from field storage configuration yml file by just changing the scale value to whatever I wanted. And then import updated configuration. I just did this couple weeks ago and it worked.

Now today I tried similar approach, to no avail. I can see the values change in the field storage configuration form, but the fields themselves still doesn't take 3 scale, just throws invalid format error.

I have local version where data contents are not important so I just deleted those fields and recreated them with the same name. Ofcourse this worked as expected, and I got those scales updated. I exported my config, and imported them in staging environment.

After importing config to stage, the result was exactly the same than changing those values to config manually. I can see the scale is 3 in the field storage config, but forms won't accept 3 decimals. Or they just round them up to 2.

So I guess my question is: What's going on here, how can I get my field configuration updated? Updating those fields manually in production env isn't really an option. It can be done, but I'd rather not.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.