Skip to content

Conversation

@mcraeteisha
Copy link
Contributor

@mcraeteisha mcraeteisha commented Feb 2, 2026

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:

  • Route accepts both template ID and process ID: If the route id is not a template, it is treated as a process ID; the controller finds the template linked via editing_process_uuid and redirects to modeler.template.show(templateId) so the URL is always the template URL.
  • When the template has an editing process, the controller returns the template modeler view with that process’s ID instead of calling 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:

  • When the template has editing_process_uuid, the controller finds the editing process and sets process_id_for_api on 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:

  • Templates: Uses this.process.process_id_for_api when present; if it’s missing, the API call is skipped (no 404).
  • Non-templates: Uses this.processId or this.process.id.

How To Test

  1. Log in to ProcessMaker. Create a Template from a Process.
  2. Edit the Template.
  3. From the Modeler, select Documentation from the Options menu.
  4. From the Documentation page, click on the Template name to return to the edit template.
    • Verify the breadcrumb works correctly, taking you to the Edit Template page for the correct Template
  5. Verify the breadcrumb works when accessing Template Documentation from the ProcessTemplatesListing page.
  6. Verify that there are no 404 errors as a result of the A/B Testing (Alternative A, Alternative B) not being found on the documentation page.

ci:deploy
ci:package-ai:bugfix/FOUR-27749

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

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@show accept either a template ID or an editing process ID, resolving the associated ProcessTemplates record 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) simplify ProcessTemplate::show’s lookup of the editing process.

Written by Cursor Bugbot for commit 8666d3f. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@vladyrichter
Copy link

QA server K8S was successfully deployed https://ci-9eb5e11524.engk8s.processmaker.net

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants