File tree Expand file tree Collapse file tree 1 file changed +8
-19
lines changed
ProcessMaker/Http/Controllers Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -77,26 +77,15 @@ public function configure(string $type, $request)
7777
7878 public function show (Request $ request )
7979 {
80- $ id = $ request ->route ('id ' );
81-
82- $ template = ProcessTemplates::find ($ id );
83-
84- if (!$ template ) {
85- // id might be a process id
86- $ editingProcess = Process::where ('id ' , $ id )->where ('is_template ' , 1 )->first ();
87- if ($ editingProcess && $ editingProcess ->uuid ) {
88- $ template = ProcessTemplates::where ('editing_process_uuid ' , $ editingProcess ->uuid )->first ();
89- if ($ template ) {
90- return redirect ()->route ('modeler.template.show ' , ['id ' => $ template ->id ]);
91- }
80+ $ template = ProcessTemplates::findOrFail ($ request ->route ('id ' ));
81+
82+ if ($ template ->editing_process_uuid ) {
83+ $ editingProcess = Process::where ('uuid ' , $ template ->editing_process_uuid )
84+ ->where ('is_template ' , 1 )
85+ ->first ();
86+ if ($ editingProcess ) {
87+ return view ('processes.modeler.showTemplate ' )->with ('id ' , $ editingProcess ->id );
9288 }
93- abort (404 );
94- }
95-
96- // If template has an editing process, show template modeler with that process id (resuming existing session)
97- $ editingProcess = $ template ->editingProcess ;
98- if ($ editingProcess ) {
99- return view ('processes.modeler.showTemplate ' )->with ('id ' , $ editingProcess ->id );
10089 }
10190
10291 $ templateApiController = new TemplateApiController (new Template );
You can’t perform that action at this time.
0 commit comments