diff --git a/ProcessMaker/Http/Controllers/ProcessController.php b/ProcessMaker/Http/Controllers/ProcessController.php index 2d3f9264da..88b84fa293 100644 --- a/ProcessMaker/Http/Controllers/ProcessController.php +++ b/ProcessMaker/Http/Controllers/ProcessController.php @@ -250,7 +250,7 @@ public function triggerStartEventApi(Process $process, Request $request) $apiRequest = new ApiProcessController(); $response = $apiRequest->triggerStartEvent($process, $request); - return redirect('/requests/' . $response->id)->cookie('fromTriggerStartEvent', true, 1); + return redirect('/requests/' . $response->id . '?fromTriggerStartEvent='); } private function checkAuth() diff --git a/ProcessMaker/Http/Controllers/RequestController.php b/ProcessMaker/Http/Controllers/RequestController.php index f97c684602..8b0ffb0b8a 100644 --- a/ProcessMaker/Http/Controllers/RequestController.php +++ b/ProcessMaker/Http/Controllers/RequestController.php @@ -76,16 +76,22 @@ public function show(ProcessRequest $request, Media $mediaItems) $definition = $startEvent->getDefinition(); $allowInterstitial = false; if (isset($definition['allowInterstitial'])) { - $allowInterstitial = filter_var($definition['allowInterstitial'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); + $allowInterstitial = filter_var( + $definition['allowInterstitial'], + FILTER_VALIDATE_BOOLEAN, + FILTER_NULL_ON_FAILURE + ); } - if ($allowInterstitial && $request->user_id == Auth::id() && request()->cookie('fromTriggerStartEvent')) { + if ($allowInterstitial && $request->user_id == Auth::id() && request()->has('fromTriggerStartEvent')) { $active = $request->tokens() ->where('user_id', Auth::id()) ->where('element_type', 'task') ->where('status', 'ACTIVE') ->orderBy('id')->first(); - return redirect(route('tasks.edit', ['task' => $active ? $active->getKey() : $startEvent->getKey()]))->withoutCookie('fromTriggerStartEvent'); + return redirect(route('tasks.edit', [ + 'task' => $active ? $active->getKey() : $startEvent->getKey() + ])); } } } diff --git a/resources/js/components/requests/card.vue b/resources/js/components/requests/card.vue index 3ed727a6a7..4fc5a044b0 100644 --- a/resources/js/components/requests/card.vue +++ b/resources/js/components/requests/card.vue @@ -79,11 +79,10 @@ export default { .then(response => { this.spin = 0; let instance = response.data; - this.$cookies.set('fromTriggerStartEvent', true, '1min'); if (this.$cookies.get("isMobile") === "true") { window.location = "/requests/mobile/" + instance.id; } else { - window.location = "/requests/" + instance.id; + window.location = `/requests/${instance.id}?fromTriggerStartEvent=`; } }).catch((err) => { this.disabled = false;