cms icon indicating copy to clipboard operation
cms copied to clipboard

[5.x]: URL lags behind generated fields

Open MoritzLost opened this issue 3 months ago • 2 comments

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

  1. 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}
  2. In a section that uses this entry type, set the entry URI format to this custom field: {custom}
  3. 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

MoritzLost avatar Nov 13 '25 16:11 MoritzLost

CMS-1675

linear[bot] avatar Nov 13 '25 16:11 linear[bot]

Related: #17938

brandonkelly avatar Nov 14 '25 00:11 brandonkelly