FOUR-13361: Incorrect Redirection After Completing a Guided Template Process by eiresendez · Pull Request #6127 · ProcessMaker/processmaker

Issue and Reproduction Steps:

Currently, when the Guided Templates process is completed and "Save and Finish" is clicked, it redirects to the assets page. However, the assets do not load and an error window.history.state is undefined appears in the console.

Solution:

  • The problem is related to the use of history.pushState. Redirecting causes these data to be lost.
  • The suggested solution is to use localStorage instead.
  • Other adjustments are formatting changes made by eslint and php-cs-fixer.

How to Test:

  • Update your Guided Templates with the latest version from the 2023-winter branch.
  • Run the "Guided invoice approval" wizard.
  • Ensure that the existing assets are correctly displayed on the /template/assets screen.
  • Check that the "continue" button functions properly and that the template is created without issues.

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.