Skip to content

bugfix/FOUR-26348: The status filter doesn't work when filtering two statuses.#8782

Open
CarliPinell wants to merge 1 commit intodevelopfrom
bugfix/FOUR-26348
Open

bugfix/FOUR-26348: The status filter doesn't work when filtering two statuses.#8782
CarliPinell wants to merge 1 commit intodevelopfrom
bugfix/FOUR-26348

Conversation

@CarliPinell
Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

After applying 2 filters to status column , the filter displays the message "No results have been found."

Solution

-Task inbox advanced filters: Group filter rows by column even when _column_field is missing or "N/A", by resolving status and process_version_alternative from the filter subject (resolveAdvancedFilterGroupKey + isTaskStatusColumnFilter). This lets multiple status rows merge correctly instead of being split across buckets and AND-ed by the API.

-Multiple = on the same enum column: Instead of collapsing to operator: "in", multiple = values for status / process_version_alternative are serialized as a single filter object with nested or chains of operator: "=" (same OR semantics as IN, compatible with ProcessMaker\Filters\Filter).

Default inbox status: Default “In Progress” (and URL-driven variants) uses the same subject shape as the column filter (Field + status) so it merges cleanly with user-defined status filters.

Backward compatibility

API contract: Payload remains a JSON array of advanced-filter objects consumed by the existing Filter::filter() pipeline; or nesting is already supported (see existing filter tests). Single-value filters and non-enum columns are unchanged.

Behavior: One status still behaves as before; multiple status values still mean OR (tasks matching any selected state), not AND—only the representation changed from in to nested = + or.
Saved searches / stored configs: Filters that already had _column_field behave as before; configs that lacked it now group correctly instead of failing silently.

How to Test

  • Login PM4
  • Go to Tasks
  • In Status Column add criteria ="In Progress" + ="Completed" and Apply
  • Both status must be shown

Related Tickets & Packages

https://processmaker.atlassian.net/browse/FOUR-26348

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.

@processmaker-sonarqube
Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@CarliPinell CarliPinell requested a review from eiresendez April 20, 2026 16:36
Copy link
Copy Markdown
Contributor

@eiresendez eiresendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may not be a bug. If QA used AND, “No results have been found” is expected behavior. The Jira ticket currently says “filter two statuses” but does not specify whether the logical operator was AND or OR, so with this PR we are making a product decision in code.

I would treat this as needing Product/QA clarification before merge. The safer resolution may be to update Jira and close/rework the PR rather than changing filter semantics.

@CarliPinell what do you think?

* @param {string} columnField - Column field name (e.g. status)
* @returns {Array}
*/
mergeFlatEnumEqualsToOrChainForColumn(filters, columnField) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Critical Issues
This PR changes explicit AND semantics into OR for multiple = filters on status / process_version_alternative.

Impact: if a user adds Status = In Progress AND Status = Completed, returning no results is expected because a single row cannot have both statuses.

The PR silently rewrites that into OR behavior, which contradicts the selected logical operator and may change valid filter semantics.

Suggested fix: do not merge this until Product/QA confirms the desired UX. If multiple status values should mean OR, the UI should make that explicit by forcing/showing OR, using in, or preventing invalid AND combinations.

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.

2 participants