Contrib Name field has components that are also indexes (not possible to encrypt)

Created on 5 October 2017, over 7 years ago
Updated 12 March 2025, 26 days ago

What:
Field Encrypt fails to encrypt the "given" and "family" fields of the "Name" fields.

Details: Contrib module "Name" creates non-standard fields in the corresponding database tables (not just _value fields).

A while back, @Decipher expanded the module to tackle these sort of fields.

In the case of field, it seems to work partially, as it encrypts the 4 of the 6 sub-fields fields in the table.
I.e: here is the "field_data_field_name" table:

mysql> describe field_data_field_name;
+-------------------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------+------------------+------+-----+---------+-------+
| entity_type | varchar(128) | NO | PRI | | |
| bundle | varchar(128) | NO | MUL | | |
| deleted | tinyint(4) | NO | PRI | 0 | |
| entity_id | int(10) unsigned | NO | PRI | NULL | |
| revision_id | int(10) unsigned | YES | MUL | NULL | |
| language | varchar(32) | NO | PRI | | |
| delta | int(10) unsigned | NO | PRI | NULL | |
| field_name_title | mediumtext | YES | | NULL | |
| field_name_given | varchar(255) | YES | MUL | NULL | |
| field_name_middle | mediumtext | YES | | NULL | |
| field_name_family | varchar(255) | YES | MUL | NULL | |
| field_name_generational | mediumtext | YES | | NULL | |
| field_name_credentials | mediumtext | YES | | NULL | |
+-------------------------+------------------+------+-----+---------+-------+

In there, I expect that _title, _given, _middle... etc are all encrypted. However, only
the Type=mediumtext fields seem to have been encrypted, but the "varchar(255)" fields,
field_name_given, field_name_family were not encrypted.

I tested this with a content type with over 4000 entries, all middle names (but NULLs)
are encrypted, but none of the first names or last names.

I will look a bit more into the code, and will test a clumpsy workaround (varchar X mediumtext),
but would love to have some hints for a fix. Glad to provide a patch if I get there.

Thanks for the module!

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States eneko1907

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.

Production build 0.71.5 2024