Closed (fixed)
Project:
Field Encryption
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2025 at 17:18 UTC
Updated:
8 Aug 2025 at 22:54 UTC
Jump to comment: Most recent
Call to undefined method Drupal\computed_field\Field\FieldStorageDefinition::getThirdPartySetting()
Error: Call to undefined method Drupal\computed_field\Field\FieldStorageDefinition::getThirdPartySetting() in Drupal\field_encrypt\ProcessEntities->getEncryptedFields() (line 215 of modules/contrib/field_encrypt/src/ProcessEntities.php).
Drupal\field_encrypt\ProcessEntities->entitySetCacheTags() (Line: 117)
Drupal\field_encrypt\Hook\FieldEncryptHooks->entityView()
call_user_func_array() (Line: 355)
Drupal\Core\Extension\ModuleHandler->{closure:Drupal\Core\Extension\ModuleHandler::invokeAll():354}() (Line: 307)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 354)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 289)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (Line: 239)
Drupal\Core\Entity\EntityViewBuilder->build()
Create a computed field.
Not sure which module is to blame but it is certainly easier to fix here.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mlncn commentedWhether other modules providing fields should always implement getThurdPartySetting or not, from Field Encrypt's point of view if that is not there the field cannot be encrypted, so we can do this check and move on. That is, this protects people using Filed Encrypt from more than only Computed Field in its current state.
Comment #4
joachim commentedWhat does this module do for base fields, which don't support third party settings either?
Comment #5
joachim commentedThis is an incorrect assumption:
A field that is not a base field is not necessarily a config field. Bundle fields can be defined in code too.
Rather than doing
> method_exists($storage, 'getThirdPartySetting
in the MR, check for whether the field is a ConfigEntityInterface.
Comment #7
ptmkenny commentedI've updated the MR to check for ConfigEntityInterface instead of method_exists(), and I also checked the rest of the code for calls to getThirdPartySetting. I identified two more places where we need to check before calling the method.
Please test this new MR and confirm it works with computed_field.
Comment #8
ptmkenny commentedComment #10
megakeegman commentedJust rebasing to resolve merge conflict in #9
Comment #11
ptmkenny commented@megakeegman Thanks for rebasing. Have you encountered this error, and does the MR fix it for your site?
Comment #12
megakeegman commentedI can confirm that I have encountered the error and that the MR does fix it
Comment #14
ptmkenny commentedCommitted and will be in the next beta, thanks everyone!