diff --git a/core/modules/workspaces/src/WorkspaceManager.php b/core/modules/workspaces/src/WorkspaceManager.php index fb609f1..1052717 100644 --- a/core/modules/workspaces/src/WorkspaceManager.php +++ b/core/modules/workspaces/src/WorkspaceManager.php @@ -212,10 +212,10 @@ public function executeInWorkspace($workspace_id, callable $function) { $previous_active_workspace = $this->getActiveWorkspace(); $this->setActiveWorkspace($workspace, FALSE); - $function(); + $result = $function(); $this->setActiveWorkspace($previous_active_workspace, FALSE); - return $this; + return $result; } /** diff --git a/core/modules/workspaces/src/WorkspaceManagerInterface.php b/core/modules/workspaces/src/WorkspaceManagerInterface.php index 7cc3494..b7a7339 100644 --- a/core/modules/workspaces/src/WorkspaceManagerInterface.php +++ b/core/modules/workspaces/src/WorkspaceManagerInterface.php @@ -60,7 +60,8 @@ public function setActiveWorkspace(WorkspaceInterface $workspace, $persist = TRU * @param callable $function * The callback to be executed. * - * @return $this + * @return mixed + * The callable's return value. */ public function executeInWorkspace($workspace_id, callable $function);