Comments (3)
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.
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...
- 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)
- 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.
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)
- Batch Process HOT 3
- Evaluate caching of decrypted data HOT 15
- add UninstallValidator HOT 5
- Write tests
- Alter database fields to accommodate encrypted content HOT 6
- Investigate field updates through CMI HOT 3
- Fix TravisCI
- Fatal errors in \Drupal\field_encrypt\FieldEncryptProcessEntities::checkField() HOT 1
- Field Encrypt incompatible with Workbench Moderation HOT 11
- Fatal error: Cannot call abstract method Drupal\Core\Entity\FieldableEntityInterface::baseFieldDefinitions() in field_encrypt/src/Entity/EncryptedFieldValue.php HOT 9
- Followup: add field deletion tests HOT 1
- Update README HOT 1
- Add a hook that allows you to select whether you want a field/entity to be encrypted as a per entity basis. (not per entity type) HOT 2
- Create plugin system for field types HOT 3
- Incompatibility with Panelizer HOT 2
- Workbench moderation + field encrypt + translations isn't working HOT 2
- Document module in readme HOT 1
- Integrate with Travis HOT 2
- Perform code review HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from field_encrypt.