Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
workspaces.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 May 2018 at 11:43 UTC
Updated:
24 Jul 2018 at 12:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
timmillwoodAs a bit of background here. The 1.x version of the module didn't have the query parameter negotiator, this was added early on in the 2.x development as a way to implement the UI design and preview each workspace with an iframe for each workspace using the query parameter. This didn't really work out and was postponed until we could work out if it was needed or not.
The email use case for the query parameter is a great one but would need to retained in the user's session unlike the original implementation where once a link was clicked the query parameter would be lost and other negotiators would be used to determine the active workspace.
Comment #3
amateescu commented@timmillwood, right, this means we need to depend on the session negotiator and use it to persist the workspace ID received as a query param.
This should do it :)
Edit: the patch doesn't apply to the contrib branch, it's written on top of the core patch from #2784921: Add Workspaces experimental module.
Comment #4
timmillwoodI don't think this would set the workspace in the query to the session. When visiting http://www.example.com/?workspace=foo
\Drupal\workspace\Negotiator\SessionWorkspaceNegotiator::setActiveWorkspace()isn't called, is it?Maybe we need an update to
WorkspaceSwitcherTestor something to test this? :)Comment #5
amateescu commentedRight! Which means we need to call it in
\Drupal\workspace\WorkspaceManager::getActiveWorkspaceright before thebreak;statement.. I think.Of course, this would need tests as well :)
Comment #6
timmillwoodComment #7
timmillwoodHow did I miss this!!?!?!
Working on it!
Comment #8
timmillwoodFixing #7 and adding a test. Although the test fails because we cache the active workspace in the
$activeWorkspaceproperty of theWorkspaceManager.Comment #10
timmillwoodRather than removing the caching I updated the test to assert the page rather than the return value from the cache.
Comment #11
fabianx commentedRTBC - Looks good to me.
Comment #12
catchCommitted 716f73d and pushed to 8.6.x. Thanks!
Comment #15
amateescu commentedFix component following module rename.