Skip to content

fix(FOUR-34515): duplicate “Assignee Permissions” Sections in Modeler Task Configuration - #9205

Open
rodriquelca wants to merge 1 commit into
developfrom
bugfix/FOUR-34515
Open

rodriquelca wants to merge 1 commit into
developfrom
bugfix/FOUR-34515

Conversation

@rodriquelca

@rodriquelca rodriquelca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

With Octane enabled, the Form Task configuration panel in the Modeler repeats the Assignee Permissions section (Escalate To Manager / Assignee Manager Escalation). Each page load that fires ModelerStarting in the same worker adds one more copy.

Cause: package-advanced-user-manager calls GlobalScripts::addScript('.../js/global.js') on every ModelerStarting event. GlobalScriptsManager is a singleton that Octane warms and does not flush, so the same path builds up across requests. The layout prints one <script> tag per entry, and each run of global.js adds the toggles to ProcessMaker.modeler.configurables again.

Steps to reproduce (Octane running, package-advanced-user-manager installed):

  1. Go to Designer and open any process.
  2. Add or select a Form Task and open the Configuration panel.
  3. Find the Assignee Permissions section.
  4. Reload the page (or open a request or case detail, which also fires ModelerStarting) and select the task again.
  5. Assignee Permissions now appears twice, and one more time after each reload.

Solution

image
  • GlobalScriptsManager::addScript() now skips a script that is already registered. Octane workers no longer output duplicate script tags.
  • Added tests/unit/ProcessMaker/Managers/GlobalScriptsManagerTest.php to cover the duplicate case.

How to Test

  1. Run herd php artisan octane:reload (a worker that is already running keeps the old registry).
  2. Open a process in the Modeler, select a Form Task, and open Configuration.
  3. Check that there is only one Assignee Permissions section, with Escalate To Manager and Assignee Manager Escalation listed once each.
  4. Reload the page several times, open a request or case detail, then go back to the Modeler. There should still be only one section.
  5. Optional: view the page source and confirm package-advanced-user-manager/js/global.js appears only once.
  6. Run php vendor/bin/phpunit tests/unit/ProcessMaker/Managers/GlobalScriptsManagerTest.php.

Related Tickets & Packages

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.

ci:deploy

@cursor

cursor Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Small guard in a singleton registry with unit test coverage; no auth or data-path changes.

Overview
Under Laravel Octane, GlobalScriptsManager::addScript() now skips paths already in the registry (strict in_array check), so warmed workers no longer accumulate duplicate global script entries when event listeners run on each request.

That stops duplicate <script> tags and repeated client-side registration (e.g. duplicate Assignee Permissions in the Modeler). A unit test asserts duplicate adds are ignored while distinct scripts still register.

Reviewed by Cursor Bugbot for commit 81540e3. Bugbot is set up for automated code reviews on this repo. Configure here.

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-5ac1620012.engk8s.processmaker.net

@decisions-sonarqube

Copy link
Copy Markdown

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