cms
cms copied to clipboard
[5.x]: URL lags behind generated fields
What happened?
Description
I'm seeing a bug where using a generated field in the URL format of a section causes to URL to 'lag behind' the generated field, i.e. always use the previous value of the generated field instead of the current value.
Steps to reproduce
- In an entry type, create a generated field custom with the template set to mirror any text field, e.g.:
{my_plaintext_field|slug|lower} - In a section that uses this entry type, set the entry URI format to this custom field:
{custom} - Create an entry and save it, then change the value in the text field and save again.
Expected behavior
Whenever the entry is saved, the URL should reflect the new value of the generated field, matching the value of the text field it is based on.
Actual behavior
The URL contains the previous value of the generated field.
Looks like generated fields and URL need to be evaluated in a different order?
Craft CMS version
5.8.18
PHP version
8.3
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
Related: #17938