-
Notifications
You must be signed in to change notification settings - Fork 680
Description
What happened?
Description
I have encountered a bug with the generated fields, where the value of a generated field, that is based on an entry field in a contentBlock field will only be changed after you have already saved when changing the entry field. It only seems to generate on the value before the change in draft is applied.
Steps to reproduce
- Make an entry type, for this example I will call it
pages
- Make a field of the Content block type, here
contentBlock
and add an Entry fieldentry
- Now add
contentBlock
to yourpages
entry type. Then go down to generated fields and entercontentBlockEntryId
with the template{contentBlock.entry.one.id ?? null}
. - Read out
{{ entry.contentBlockEntryId }}
on the page template.
Expected behaviour
This should, when properly implemented mean that when changing the entry
field to a different entry, and we save the generated field will display the id of the page we selected.
Actual behavior
However, in reality when we read out {{ entry.contentBlockEntryId }}
after changing the Entry field the first time it will still display null
. Then when resaving the page but changing nothing, the id suddenly is shown.
This continuous when changing, or emptying the entry value. The value contentBlockEntryId
is consistent to the value it was before the drafted change is applied when saving.
Craft CMS version
Craft Pro 5.8.18
PHP version
8.4.10
Operating system and version
Linux 5.15.0-144-generic
Database type and version
MySQL 8.0.42
Image driver and version
Imagick 3.8.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
CKEditor - 4.10.1
Craft Meilisearch - 5.10.0
Formie - 3.1.4
Image Resizer - 4.0.4
Maps - 5.0.4
Navigation - 3.0.13
Retour - 5.0.12
Sentry Logger - 5.0.2
SEOmatic - 5.1.17
Smith - 3.1.1
Template Comments - 5.0.4
Vite - 5.0.1