Enum properties do not reflect value change

Created on 30 November 2023, 7 months ago
Updated 10 January 2024, 6 months ago

First of all: Thanks for sharing Enum Field! I think it is a neat module for mapping code to field values instead of the other way around.

Problem/Motivation

Predetermined value of enum fields are returned even after updating the field.

Steps to reproduce

1. Retrieve value of an enum field using $entity->get('field_my_enum')->enum or $entity->get('field_my_enum')->enums()
2. Update the value of the field $entity->set('field_my_enum', MyEnum::someValue)
3. Retrieve the value of the enum field again $entity->get('field_my_enum')->enums()
4. See that the returned value is the same as in step 1 but should be MyEnum::someValue as set in step 2.

Proposed resolution

Remove storage of previously retrieved value in ComputedEnum.

Remaining tasks

- Agree on solution
- Implement solution

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡°Denmark kasperg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024