Skip to content

Obsidian Workflow Entry rewrites the address bar to /page/{id}, losing the page's named route #6988

Description

@zackdutra

Description

The Obsidian Workflow Entry block updates the browser URL after each form step so the workflow is easy to copy and paste (workflowEntry.obs calls window.history.replaceState(null, "", response.data.url)). The URL it pushes is built server-side by RockBlockTypeExtensions.GetCurrentPageUrl(), which constructs the PageReference from only the page guid:

var pageReference = new Rock.Web.PageReference( block.PageCache.Guid.ToString(), parameters );

A PageReference created this way has no RouteId, so BuildUrl() falls back to the /page/{PageId} form. The visitor lands on a friendly named route (e.g. /mandated-reporter), submits the form, and watches the address bar silently change to /page/4430?WorkflowGuid=.... The URL still works — but the named route the site deliberately published is discarded, which looks broken to members and produces two competing URLs for the same page in anything they copy or bookmark.

Suggested Fix

In GetCurrentPageUrl() (Rock/Utility/ExtensionMethods/RockBlockTypeExtensions.cs), seed the PageReference with the current request's route, e.g. use block.RequestContext's page reference (PageId + RouteId) as the basis instead of constructing from the page guid alone, so BuildUrl() can emit the named route when one was used.

Actual Behavior

The rewritten URL is /page/{PageId}?WorkflowGuid=... — the named route is lost.

Expected Behavior

The rewritten URL keeps the route the visitor arrived on: /mandated-reporter?WorkflowGuid=....

Steps to Reproduce

  1. Create a page with a named route (e.g. /mandated-reporter) containing an Obsidian Workflow Entry block (BlockType guid 9116AAD8-CF16-4BCE-B0CF-5B4D565710ED) pointed at any workflow type with an entry form.
  2. Visit the page via its named route and submit the form.
  3. Observe the address bar: the path changes from /mandated-reporter to /page/{PageId}?WorkflowGuid=....

Issue Confirmation

  • Perform a search on the Github Issues to see if your bug is already reported.
  • Reproduced the problem on a fresh install or on the demo site.

Rock Version

17.6

Client Culture Setting

en-US

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions