If you save a blank value for a fraction, _fraction_decimal_widget_validate takes the blank decimal value, converts it to a fraction (0/1), and then the fraction_field_is_empty() logic does not interpret "0" as empty, and saves the field to the database.

This is similar to #3096236: Clearing a fraction field sets it to zero in 8.x-1.x, and may have actually been a result of the fix that was made in #3005491: Fraction with numerator of 0 is considered empty.

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Issue summary: View changes

  • m.stenta committed b2c9d9f on 7.x-1.x
    Issue #3135819: Saving a blank fraction field saves a zero value
    
m.stenta’s picture

Status: Active » Fixed

Fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.