Cache needs to be cleared after adding encryption to a field for custom entity

Created on 23 October 2017, over 7 years ago
Updated 26 September 2024, 7 months ago

This took me a while to figure out because it is my first time using this module.

After enabling encryption on a field for the first time, some part of the site cache needs to be cleared before values will be displayed correctly. If you do not clear the cache, the value for the encrypted field will be "[ENCRYPTED]" on both the entity form and the entity display (see screenshots).

In my simple tests, this issue does not affect fields on Nodes. It does affect fields on Profile entities. Perhaps there is something within the node module that is clearing the necessary cache when fields are updated that is not in the Profile module (and perhaps not in other modules that create their own fieldable entities).

How to replicate:

  1. Install Profile module
  2. Create a new profile type
  3. Add a text field to the new profile type (do not encrypt the field), and save it.
  4. Edit the new field and enable encryption.
  5. Create a new Profile of the new profile type, provide data to the new field, save the profile.
  6. The field value will display as "[ENCRYPTED]" on both the form and the display of the profile.
  7. Clear cache to fix the issue.

Screenshots

πŸ› Bug report
Status

Closed: outdated

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States daggerhart

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡―πŸ‡΅Japan ptmkenny

    There were major changes to how caching was handled in 3.x. 2.x is no longer being developed, so I'm closing this as outdated.

    If you have a caching issue in 3.x, please open a new issue with steps to reproduce.

Production build 0.71.5 2024