Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ProcessMaker/Http/Controllers/ProcessController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 9 additions & 3 deletions ProcessMaker/Http/Controllers/RequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
]));
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions resources/js/components/requests/card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down