FOUR-27749 | Editing A Template Displays a Server Error When Returning From Documentation #8715
+35
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.





Issue
Ticket: FOUR-27749
Clicking the template name breadcrumb from the Documentation page in the template modeler caused a server error. The breadcrumb link used an incorrect ID, leading to a null reference when accessing template properties.
The Alternative Tabs (A/B testing) API is called with the correct process ID and no longer returns 404 when opening Template Documentation from the listing.
Solution
Updated
ProcessMaker/Http/Controllers/TemplateController.php:editing_process_uuidand redirects tomodeler.template.show(templateId)so the URL is always the template URL.ProcessTemplate::show(which would delete the process and create a new one). Users stay on the template modeler URL and see the latest process state (e.g. Alternative B) without getting a new process ID.Updated
vendor/processmaker/package-ai/src/Http/Controllers/PackageAiDocumentationController.php:editing_process_uuid, the controller finds the editing process and setsprocess_id_for_apion the process object passed to the view so the frontend can call the ab-testing API with the correct process ID.Updated
vendor/processmaker/package-ai/resources/js/components/AlternativeTabs.vue:this.process.process_id_for_apiwhen present; if it’s missing, the API call is skipped (no 404).this.processIdorthis.process.id.How To Test
ci:deploy
ci:package-ai:bugfix/FOUR-27749
Code Review Checklist
Note
Medium Risk
Changes routing/lookup logic for template editing and introduces a new Eloquent relationship; incorrect resolution could misroute users or expose unexpected 404s, but scope is limited to template modeler entry points.
Overview
Fixes template modeler navigation errors by making
TemplateController@showaccept either a template ID or an editing process ID, resolving the associatedProcessTemplatesrecord and redirecting to the canonical template URL when needed.Adds a
ProcessTemplates::editingProcess()relationship and uses it to (a) render the modeler with the existing editing process ID when present (avoiding recreating the process) and (b) simplifyProcessTemplate::show’s lookup of the editing process.Written by Cursor Bugbot for commit 8666d3f. This will update automatically on new commits. Configure here.