Closed (outdated)
Project:
Field Encryption
Version:
8.x-2.0-alpha1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
8 Aug 2017 at 11:52 UTC
Updated:
19 Sep 2022 at 04:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jitendra verma commentedComment #3
jitendra verma commentedComment #4
daggerhart commentedI've run into this problem as well. Patch approach seems fine (testing that the entity can be loaded).
One very minor nitpick with the patch is defining variables for values that already exist in the $data variable. You could easily perform the entity existence check like this:
\Drupal::entityTypeManager()->getStorage($data['entity_type'])->load($data['entity_id']);Regardless, this patch applies and works for me, marking as reviewed.
Comment #5
perarg commentedIt doesn't seem to work in 8.7.x. The problem seems to be that some entities allow revisions and others don't. The solution to this is to check if the entity type allows revision so in that case the check should be with loadRevision(). Otherwise the load() function should be used to get the entity.
Here is a patch fixing things. I have included also, @daggerhart little tip.
Comment #7
maskedjellybean#5 works for me on 8.7.5! Thanks perarg!
Comment #8
ptmkenny commentedI'm closing this issue because this is fixed in 3.x; UpdateEntityEncryption.php already contains similar logic.