Problem/Motivation

Values in decimal fields are not saved anymore. Existing values are getting lost after saving the form.

Steps to reproduce

Saving encrypted decimal field in drupal ^10.2

Data model changes

looks like the data type of the field has (silently) changed to "decimal". It was "string" before.

Proposed resolution

Checking on "decimal" in `getUnencryptedPlaceholderValue()`

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 3465540-drupal-10.2 Comparechanges, plain diff MR !47
  • 1 hidden branch
  • 3.0.x Comparecompare

Comments

pp.panatom created an issue. See original summary.

pp.panatom changed the visibility of the branch 3.0.x to hidden.

pp.panatom’s picture

Status: Active » Needs review

added patch/merge request

ptmkenny’s picture

Status: Needs review » Needs work
ptmkenny’s picture

ptmkenny’s picture

Status: Needs work » Closed (outdated)

Actually this was already fixed in the 3.2.x branch, so I'm closing this.

pp.panatom’s picture

Looks like the fix did not make it into 3.2.0?

I could not find a change record for this in core. But it used to work before 10.2.
For backwards compatibility, the code for handling the "string-decimal" is still in there. So decimals with string data type are still handled like before.

ptmkenny’s picture

3.2.0 has some trouble handling decimal values still; please try the MR in #3488771: Encrypted decimal field value not saved on drupal version 10.2.x+ and see if that fixes your issue.