1

If I set a default value on a decimal or integer field, the user cannot delete the default value and save the node.

They can set the value to another value including zero, and that is saved correctly.

But if the contents of the field is deleted, on save, the field is automatically populated with the default value again.

This doesn't seem right. I guess I could intercept the empty field and set it to zero, but surely that's not necessary? Am I missing something?

2

This is a bug in D7. Checkout https://www.drupal.org/node/1253820. I checked it works while editing content but not while creating. This has been fixed in D8. For D7, you can write custom code to handle this.

| improve this answer | |
  • THANK YOU! I have worked around it, but I thought I must have done something idiotic to cause the problem and had added a messy kludge to fix. Feel much better now I know it's not me! :-D – Victoria Mar 27 '15 at 17:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.