The module currently only works with nodes, it should be updated to work with all entities.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NotGoddess’s picture

Status: Active » Needs review
FileSize
5.75 KB

I had to update this to work with field on user entity fields, so I made this patch. I've tested it with nodes, taxonomies and users but not other entity types. I updated the function names to reflect it works with entities, not just nodes.

It goes against the 1 fix per issue mode but I also addressed the following, as I needed it for my work:

  • I kept the language fixes from #1474984 but updated to work with entities.
  • I changed the form_alter to be a field_ui_edit_form specific form_alter
  • I added a _is_serialized function so field caught in the flux (that were marked to be encrypted but were not) don't cause the offset error. Unsure if it'll be a performance hit-may need to fix this via an update function.

I noticed another issue that needs to be addressed - encryption on fields with a short max length, but I'll open an issue for that after this.

bennybobw’s picture

Status: Needs review » Needs work

I just tried this patch on a profile2 entity. It works when writing to the db, but the default value on the form field not get decrypted, so it shows the encrypted text when you load the form.