Giter Club home page Giter Club logo

Comments (3)

TravisCarden avatar TravisCarden commented on June 24, 2024

This issue will be a critical blocker for sites that need to encrypt financial data, for example. It already is for me.

Drupal\Core\Entity\EntityStorageException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '[ENCRYPTED]' for column 'field_price_value' at row 1: INSERT INTO {node__field_price} (entity_id, revision_id, bundle, delta, langcode, field_price_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 1165 [:db_insert_placeholder_1] => 1165 [:db_insert_placeholder_2] => example [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => en [:db_insert_placeholder_5] => [ENCRYPTED] ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 757 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

from field_encrypt.

nerdstein avatar nerdstein commented on June 24, 2024

If I recall, we had to set values because the solution did not work without it. (e.g. something in core was expecting some value).

Theres two avenues here...

  1. We keep this for strings and try just removing any value for numeric / date / or other core provided data types. We would need a hook for other custom field values to set their own value (or lack thereof)
  2. We explore why we couldn't save nothing and try to submit a core patch or revisit alternatives so we have no default values - which is both confusing and clunky (misrepresenting the fact that the data value is stored altogether elsewhere)

from field_encrypt.

svendecabooter avatar svendecabooter commented on June 24, 2024

I have created a new PR that sets some sensible placeholder values, based on the property data type.

We should indeed probably explore how we can let Drupal core know that there is a particular value for the field (stored encrypted elsewhere), without having to provide a placeholder.

But until we've found a way to handle that (if possible at all), the PR at least makes sure that current core field types don't result in errors when trying to encrypt them.

from field_encrypt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.