In the request validation examples, a validator who approves with a comment writes it to the validation variable (routing on validation.result proves the write), but the operator viewing the submission at the process step sees the OLD "request changes" note instead. Two gaps compound:

  • WebformInteraction only surfaces feedback_variable as an edit-form prefill query parameter; view mode has no way to render the variable's current comment, and the process steps in both example workflows configure no feedback_variable anyway.
  • The prefill writes the reviewer note into a real submission element (feedback, prepopulate plus readonly on request_form_link), so each "request changes" note is frozen into the submission at resubmit time and later shown to everyone as if current.

Fix: teach WebformInteraction view mode to render the feedback_variable's current comment as a labelled "Reviewer note" item above the submission view; set feedback_variable: validation on the process step in request_validation and request_validation_link; retitle the baked-in element so the frozen copy is honest (for example "Reviewer feedback at last revision"). Add a kernel test covering approve-with-comment after a changes round.

Issue fork orchestra-3608397

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Title: The webform view mode never shows the current reviewer comment, and a stale prefilled note impersonates it » Surface live workflow context as Drupal messages via context_display, replacing the stored feedback prefill
Status: Active » Needs review
mably’s picture

MR !285 reworks this generically rather than patching the prefill (nothing released, so the old mechanism is replaced outright).

  • New context_display setting on the webform interaction: a list of {variable, label, severity} entries. Each resolves the variable's CURRENT value (dotted paths, e.g. validation.comment) and posts it as a Drupal message, so it reaches the actor in view mode and on every page of a wizard form, under both doorways, always live from the instance and never stored into the submission.
  • The request that completes the step withdraws its own messages, so an obsolete note never flashes onto the confirmation page after submit; until then the note shows on every visit and reload.
  • feedback_variable / feedback_element and the frozen "Reviewer feedback" element are removed from code, schema and the example webforms.
  • The examples record the validation decision at token scope, so each round's decision stays on its own consumed token as history while later steps read the current round.
  • New metadata-only InteractionResolver::declaredInteractionOn() also reads the interaction_task shape, so task steps get the same display; the dispatch-guarding interactionOn() is untouched.

Coverage: a new ContextMessages kernel test (dotted paths, severity fallback, config-shaped entry sanitizing, branch-scoped resolution), and RequestValidationTest drives the reported regression end to end over HTTP in both doorways: the poster sees the changes note on every wizard page and on reload until the resubmit, the confirmation page does not repeat it, and the processor sees the current approval comment instead of the stale note. Also validated manually on a live site.

The issue title was updated to describe the rework, since it becomes the commit message.

  • mably committed 55a42a6d on 1.x
    fix: #3608397 The webform view mode never shows the current reviewer...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.