Skip to content

FOUR-25589 | Status Filtering In a Settings Tab Created From LaunchPad Does Not Work Correctly#8766

Open
mcraeteisha wants to merge 5 commits intodevelopfrom
bugfix/FOUR-25589
Open

FOUR-25589 | Status Filtering In a Settings Tab Created From LaunchPad Does Not Work Correctly#8766
mcraeteisha wants to merge 5 commits intodevelopfrom
bugfix/FOUR-25589

Conversation

@mcraeteisha
Copy link
Copy Markdown
Contributor

@mcraeteisha mcraeteisha commented Mar 31, 2026

Issue

Ticket: FOUR-25589

When a Saved Search tab (e.g., "To Do") is used in a Launchpad process banner, filtering by a different status (e.g., "Completed" or "Self Service") via the column filter popover returns no results.

Solution

The Saved Search's PMQL (e.g., status = "In Progress") conflicts with the advanced filter's status (e.g., Status = "Completed"), producing an impossible SQL condition (status IN ('ACTIVE') AND status IN ('CLOSED')).
The fix strips the status condition from the PMQL when the request also includes an advanced_filter with a Status type, allowing the column filter to take precedence. When no status column filter is applied, the PMQL status is preserved as before.
Additionally, filtering by "Self Service" in a "To Do" or "Completed" Saved Search returned no results because the PMQL's user_id = X condition conflicts with self-service tasks, which have user_id = NULL. When the status filter is specifically "Self Service", the user_id condition is also stripped from the PMQL. User-scoping is still enforced by the existing applyForCurrentUser method.

How To Test

  1. Run phpunit tests/Feature/Api/TasksTest.php
    • Verify testAdvancedStatusFilterOverridesPmqlStatus passes
    • Verify testPmqlStatusPreservedWhenNoAdvancedStatusFilter passes
    • Verify testSelfServiceFilterOverridesPmqlStatusAndUserId passes
  2. Log in to ProcessMaker. Go to "Processes".
  3. Select a Process from the LaunchPad.
  4. Create a new tab in the Process Banner.
  5. Choose the 'To Do' saved search. Give the tab a name and save it.
  6. Click on the new tabe created with the 'To Do' saved search. Go to the Status column.
  7. Filter by "Status = Completed"
    • Completed tasks should display in the table.
  8. Filter by "Status = Self Service"
    • Self-service tasks should display in the table.

ci:deploy

.

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.

When an advanced_filter includes a Status condition, remove any status clauses from the incoming PMQL to avoid duplicate or conflicting status filters. Adds helper methods advancedFilterHasStatus() and removeStatusFromPmql(), and returns early if PMQL becomes empty after removal. The removal uses regex to strip status predicates joined by AND and trims the resulting PMQL.
Add two feature tests to TasksTest that verify status filter precedence for the tasks API. One test (testAdvancedStatusFilterOverridesPmqlStatus) ensures an advanced Status filter overrides a conflicting pmql status clause; the other (testPmqlStatusPreservedWhenNoAdvancedStatusFilter) ensures the pmql status clause is respected when no advanced Status filter is provided. Both tests create an admin user and two ProcessRequestToken tasks (ACTIVE and CLOSED) and assert the returned task IDs match the expected filtering behavior.
@Kookster310
Copy link
Copy Markdown
Contributor

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

Update task index filtering to recognize a 'Self Service' advanced filter and remove user_id constraints from PMQL so self-service tasks (which may have null user_id) are returned. Added helpers to parse advanced_filter payloads (getAdvancedFilterArray, advancedFilterHasSelfServiceStatus) and a removeUserIdFromPmql method that strips user_id clauses. Also adjusted advancedFilterHasStatus to use the new parser. Added a feature test (testSelfServiceFilterOverridesPmqlStatusAndUserId) to verify the behavior.
@processmaker-sonarqube
Copy link
Copy Markdown

@Kookster310
Copy link
Copy Markdown
Contributor

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

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