Problem/Motivation

Entering an absolute URL in the Workspace preview redirect field is error-prone. Relative redirect targets should be better in letting the users stay in the same environment.

Steps to reproduce

Proposed resolution

Keep backwards compatibility for already generated absolute redirects, but enforce relative redirects when creating new ones.

Remaining tasks

Post a PR

User interface changes

API changes

Data model changes

Issue fork wse-3479130

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

alecsmrekar created an issue. See original summary.

alecsmrekar’s picture

Title: Make preview link relative » Force relative redirect links (wse_preview)

alecsmrekar’s picture

Assigned: alecsmrekar » Unassigned
Status: Needs work » Needs review
amateescu’s picture

Component: Code » Workspace Preview

Moving to its own component :)

amateescu’s picture

Status: Needs review » Needs work

Posted a comment in the MR.

alecsmrekar’s picture

Thanks Andrei, I pushed another commit enabling validation on the path.

alecsmrekar’s picture

Status: Needs work » Needs review
amateescu’s picture

Status: Needs review » Fixed

Cool, that means we don't need the custom validation anymore. Pushed a commit to remove it, and merged the MR to 2.0.x, thanks!

plach’s picture

Status: Fixed » Needs review
StatusFileSize
new1.86 KB

This was not working as intended: I got errors when testing this with legacy redirects containing absolute URLs. The attached PR just turns the redirect into a relative URL.

plach’s picture

Sorry, minor cleanup.

alecsmrekar’s picture

Thanks, I tested this and it works as expected, no errors :)

  • amateescu committed bead9856 on 2.0.x
    Issue #3479130 followup by plach: Force relative redirect links (...

  • amateescu committed d6ae3abb on 1.0.x
    Issue #3479130 followup by plach: Force relative redirect links (...
amateescu’s picture

Status: Needs review » Fixed

Committed the followup, thanks!

Status: Fixed » Closed (fixed)

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

amateescu’s picture

Project: Workspaces Extra » Workspace Preview
Version: 2.0.x-dev » 1.0.x-dev
Component: Workspace Preview » Code

WSE Preview has been promoted to a standalone module: https://www.drupal.org/project/workspace_preview