Skip to content

make reference tags parsing work with generated fields#18725

Closed
i-just wants to merge 2 commits into5.10from
feature/18692-ref-tags-and-generated-fields
Closed

make reference tags parsing work with generated fields#18725
i-just wants to merge 2 commits into5.10from
feature/18692-ref-tags-and-generated-fields

Conversation

@i-just
Copy link
Copy Markdown
Contributor

@i-just i-just commented Apr 16, 2026

Description

Adds the ability to parse generated fields in reference tags.

To test:

  • create a section with an entry type that has a generated field with a handle of myTest and a value of abcde
  • create an entry in that section
  • create a twig template with the following code: <p>{{ craft.app.elements.parseRefs('{entry:194:myTest}') }}</p> (replace the number with the actual ID of the entry from the previous step)
  • view that template in a browser

Before this change, the result would be the entry’s URL (if the section is configured with URIs) or an empty string (if configured without URIs).

With this change, you should see abcde.

Related issues

#18692

@i-just i-just requested a review from brandonkelly April 16, 2026 10:21
@brandonkelly
Copy link
Copy Markdown
Member

This ended up being just a bug in Element::__isset(), which wasn’t checking for generated field values, so I fixed it there, and that felt like a reasonable 5.9.x change.

@brandonkelly brandonkelly deleted the feature/18692-ref-tags-and-generated-fields branch April 22, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants