After using a preview link a cookie is set which is not properly cleared when trying to switch workspaces. This prevents other workspace negotiators to be selected when setting the new active workspace.

Steps to reproduce:

1. create two workspaces
2. activate the first and generate the preview link
3. use the preview link (in the current session) and confirm that the preview link worked correctly and that the 'wse_preview' cookie has been set
4. try switching to the second workspace

The attached patch tries to solve this issue.

Comments

paranojik created an issue. See original summary.

plach’s picture

Status: Needs review » Needs work

Looks good and works well, thanks!

+++ b/modules/wse_preview/src/WsePreviewWorkspaceManager.php
@@ -0,0 +1,138 @@
+  public function __construct(WorkspaceManagerInterface $inner, CookieWorkspaceNegotiator $cookie_workspace_negotiator, RequestStack $request_stack) {

Nit: we can rely on constructor property promotion here :)

paranojik’s picture

Status: Needs work » Needs review
StatusFileSize
new3.86 KB

Fixed the nit @plach. Thanks!

  • amateescu committed 7e38b398 on 2.0.x
    Issue #3473673 by paranojik, plach: Can't switch workspace after using...

  • amateescu committed afa1160c on 1.0.x
    Issue #3473673 by paranojik, plach: Can't switch workspace after using...
amateescu’s picture

Status: Needs review » Fixed
StatusFileSize
new3.55 KB
new2.45 KB

Made a few cosmetic changes, and committed to 2.0.x, 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