Set Admin User as Default run_as_user_id When Importing Scripts by sanjacornelius · Pull Request #6208 · ProcessMaker/processmaker

Issue & Reproduction Steps

This PR addresses an issue discovered during the import of scripts from Guided Templates where scripts lacking a run_as_user_id caused a A user is required to run scripts. error when running the Re-run Wizard process. To resolve this, the PR implements setting the admin user as the default run_as_user_id when importing such scripts.

How to Test

  1. Ensure your environment has the latest Guided Templates synced php artisan processmaker:sync-guided-templates.
  2. Create a process from the Guided Template.
  3. Navigate to that process's Launchpad.
  4. Select "Re-run Wizard."
  5. Complete the wizard.
  6. Navigate to "Requests -> All Requests."
  7. Select the recently completed request (the status may initially show as "cancelled").
  8. View the summary data.
  9. Ensure no errors such as _configuration_error_node_212 are present.

Example Error that was previously returned:

unnamed

Related Tickets & Packages

ci:next

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.