- First commit to issue fork.
- last update
11 months ago 11 pass - πΊπ¦Ukraine AstonVictor
Created a new MR to support computed fields.
Steps for testing:
1. Create a new computed field of the 'email' type for the user entity type and its callback.
e.g./** * Implements hook_entity_base_field_info(). */ function {MODULE}_entity_base_field_info(EntityTypeInterface $entity_type) { $fields = []; switch ($entity_type->id()) { case 'user': $fields['computed'] = \Drupal\Core\Field\BaseFieldDefinition::create('email') ->setLabel(t('Computed mail')) ->setCardinality(1) ->setComputed(TRUE) ->setCustomStorage(TRUE) ->setClass('\Drupal\{MODULE}\Field\{MODULE}EmailField'); break; } return $fields; }
2. Create a new Contact form on the
/admin/structure/contact/add
page and add a new user reference field.
3. Create a new Contact email on the/admin/structure/contact/emails/add/add
page and select the contact form from the above.
4. Select the 'The value of a specific field in an entity reference' value for the 'Recipient type' field.Results: you should see your computed field. Creating a new contact message should send an e-mail to the e-mail address from the computed field.
-
AstonVictor β
committed 45acbb21 on 8.x-1.x
Issue #3156538 - Add computed fields
-
AstonVictor β
committed 45acbb21 on 8.x-1.x
- Status changed to Fixed
11 months ago 2:52pm 7 February 2024 - πΊπ¦Ukraine AstonVictor
Merged the MR.
Changes will be added to the next release.
Automatically closed - issue fixed for 2 weeks with no activity.