REST raw output makes field unavailable in replacement patterns

Created on 7 March 2023, almost 2 years ago
Updated 13 March 2023, almost 2 years ago

Problem/Motivation

When you check a field to be rendered raw, it will not be available as replacement pattern for upcoming fields.

Steps to reproduce

Create a new node view as REST export.
Add the node title as field.
Under "Format" -> "Show: fields" -> "Settings" check the "Raw output".
Add a "Global: custom text" and use the {{ title }} replacement pattern in it.

You would expect to see the title twice in the results.
But you will only see it once, second field will be empty.

Proposed resolution

Call "postRender" on the field even when using raw output in order to populate it's "last_render" attribute.
Thus the value is available also when this is retrieved from cache.

Remaining tasks

Review the patch

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

🐛 Bug report
Status

Needs work

Version

9.5

Component
REST 

Last updated 10 days ago

Created by

🇷🇴Romania reszli Târgu Mureș

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024