processmaker icon indicating copy to clipboard operation
processmaker copied to clipboard

Ordering the processes correctly when starting the process - PM4EH-280

Open paulosakamoto opened this issue 3 years ago • 0 comments

Issue & Reproduction Steps

There is a sorting error when multiple categories (category_assignments table) are associated with a process.

This happens because it is ordered by the associated category in the processes.process_category_id column.

Unable to sort correctly on front-end because of pagination which brings partial results.

Solution

  • Change the query to bring the related category in category_assignments and order it correctly.
  • Do not change the default API output, to maintain backwards compatibility and not cause unexpected bugs.

PM4EH-280-sorting-issue.webm

How to Test

  • Create a category "1", "A", "B"
  • Create processes with these names for category "A": "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8"
  • Create processes with these names for category "B": "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8"
  • Associate a second category "1" to the processes: "A4", "A6", "B5", "B1"
  • The first page should contain category "1" with the 4 related processes.

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.

.

paulosakamoto avatar Jan 25 '23 14:01 paulosakamoto