Per arknoll:
I just installed these three sets of dependencies and translations aren't being displayed appropriately. Here is what I did.
Enabled all modules (workbench moderation, key, encrypt, field encrypt, real_aes, content translations, translate)
Set up workflow states (draft, review, publish, archive) and transitions between each state
Added workflow to basic page content type
Added a test key and encryption profile.
Enabled French translation on the site
Encrypted the body field on the basic page
Created a basic page node and transitioned to review
Created a french translation of the node and saved as draft
Expected result, viewing the french draft would display the french content
Actual result, viewing the french draft shows the english content.
This works as expected when workbench moderation is not being used.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2735927-8-test.patch | 2.35 KB | dawehner |
| #8 | 2735927-8.patch | 5.64 KB | dawehner |
| #7 | 2735927-6.patch | 12.66 KB | dawehner |
| #6 | 2735927-6.patch | 3.56 KB | dawehner |
| #4 | 2735927-4.patch | 3.56 KB | dawehner |
Comments
Comment #2
dawehnerAs talked with @nerdstein this is probably "just" the problem that field encrypt doesn't support translations at all.
Comment #3
dawehnerReporting some progress ...
It turns out we store a different value for the translated value in the DB:
Given that I guess this is a rendering problem.
Comment #4
dawehnerSo @nerdstein and myself discussed that a bit.
There are two possibilities to implement proper translation and revision support:
Comment #5
dawehnerI'm not 100% convinced that going with the way 1) is the only possibility we have, but it certainly simplifies things a lot.
Comment #6
dawehnerHere is a try to actually add some test coverage just for that case, turns out, either the test or the actual implementation is still wrong.
Comment #7
dawehnerThis time also with the test.
Currently I'm a bit buffled about
For the testcase the languages are 'en', and 'fr', but the entity internally stores in 'fr' and 'x-default', which is maybe a problem here as well.
Comment #8
dawehnerIts tricky. I tried to write the tests properly on the storage layer, but I could not yet reproduce the issue on that layer.
While working on the test I realized a couple of issues though:
* We use a hook which is cached, see #2743073: hook_entity_storage_load() is cached
* We potentially re-encrypt '[ENCRYPTED_VALUE]'. I haven't figured out when this happens exactly, but I've seen the behaviour while writing the tests
* The tests require a
$storage->reset()call for some reasonComment #9
nerdsteinI've reviewed this patch and it seems to be working as intended for this module. I can't rule out any issues with WBM though but the test proves that Field Encrypt seems to be working and respecting both revisions and translations properly now.
Comment #10
arknoll commentedI have also reviewed and it appears to be working for me.
Thank you!
Comment #11
nerdsteindawehner, the patch for the code is great, but the test patch is failing. I tried to rebuild the test patch in #8 from the patch in #6 and there are gaps. Can you take a look?
Comment #12
nerdsteinFrom FieldEncryptStorageTest class: missing "assertRawEncrypedFieldDataEntry" function and "assertRawEncryptedValues" has a missing third parameter I can't find ;)
Comment #14
nerdsteinComment #15
ptmkenny commentedThis was fixed in #13, so I'm closing the issue now. If you have a similar problem, please open a new issue.