REST raw output makes field unavailable in replacement patterns

Created on 7 March 2023, over 1 year ago
Updated 13 March 2023, over 1 year 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 6 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

  • Issue created by @reszli
  • Status changed to Needs review over 1 year ago
  • 🇷🇴Romania reszli Târgu Mureș
  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue under control, following Review a patch or merge request as a guide.

    Thank you for reporting this bug.
    As a next step it will need a test case to show the bug.

Production build 0.71.5 2024