Support for Double Field

Created on 26 June 2023, over 1 year ago

Problem/Motivation

The popular Double Field module fields can't be encrypted.

When enabling field encryption to a Douple Field field gives a notice:

Attempt to update field Change date failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node_revision__field_change_date.field_change_date_value' in 'where clause': SELECT "base_table"."vid" AS "vid", "base_table"."nid" AS "nid" FROM "node_revision" "base_table" INNER JOIN "node_revision__field_change_date" "node_revision__field_change_date" ON "node_revision__field_change_date"."revision_id" = "base_table"."vid" WHERE "node_revision__field_change_date"."field_change_date_value" IS NOT NULL; Array ( ) .

The process queue don't pick up the change, but on the /admin/config/system/field-encrypt/field-overview appears the configured field, but in the database the data is clear text (because the process queue is not obviously run).

Choosing "Decrypt" > "Remove field Encryption"> from the operations throws the same error:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node_revision__field_reviewers.field_reviewers_value' in 'where clause': SELECT "base_table"."vid" AS "vid", "base_table"."nid" AS "nid" FROM "node_revision" "base_table" INNER JOIN "node_revision__field_reviewers" "node_revision__field_reviewers" ON "node_revision__field_reviewers"."revision_id" = "base_table"."vid" WHERE "node_revision__field_reviewers"."field_reviewers_value" IS NOT NULL; Array ( ) in Drupal\Core\Entity\Query\Sql\Query->result() (line 271 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
Drupal\Core\Database\StatementWrapper->execute(Array, Array) (Line: 945)
Drupal\Core\Database\Connection->query('SELECT "base_table"."vid" AS "vid", "base_table"."nid" AS "nid"
FROM
{node_revision} "base_table"
INNER JOIN {node_revision__field_reviewers} "node_revision__field_reviewers" ON [node_revision__field_reviewers].[revision_id] = [base_table].[vid]
WHERE "node_revision__field_reviewers"."field_reviewers_value" IS NOT NULL', Array, Array) (Line: 514)
Drupal\Core\Database\Query\Select->execute() (Line: 271)

Steps to reproduce

  • Install and Double Field and configure Field Encrypt module.
  • Add a field type Double Field to a Node type. Let's use Article and the field a "Change Date".
  • Configure the Double Field subfields: Text and Float. Set "Allowed number of values" to unlimited and name the subfields.
  • Create and article with some data in the Double Fields fields.
  • Configure encryption and try to turn on the field encryption for the Double Field field.
Feature request
Status

Active

Version

3.1

Component

Code

Created by

🇩🇪Germany TipiT Hamburg

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

Comments & Activities

Production build 0.71.5 2024