Wappler 7.6.1 – Query with multiple optional GET parameters only works when more than one condition is provided

======== BUG REPORT ========

Wappler Version: 7.6.1
Operating System: Windows 11
Server Model: PHP
Database Type: MySQL
Hosting Type: Local development (Windows / Apache)


Expected behavior

The database query should return results when any single optional filter is provided.

The query is built using the Wappler Query Builder with multiple optional GET parameters (equal / contains conditions).
Each condition should only be applied when its corresponding GET parameter is present.

This behavior worked correctly in Wappler 7.4.1 or previous.


Actual behavior

After upgrading to Wappler 7.6.1, the query only returns results when two or more optional conditions are provided at the same time.

When only one GET parameter is set:

  • No errors are shown

  • Query executes normally

  • Result set is empty

When two or more GET parameters are set:

  • Query returns results correctly

It behaves as if optional conditions have become mandatory.


How to reproduce

  1. Create a Server Connect action using a Database Query (Query Builder)

  2. Use multiple optional conditions, all based on GET parameters, for example:

    • work_tool_id = {{$_GET.work_tool_id}}

    • operation_id = {{$_GET.operation_id}}

    • function_id = {{$_GET.function_id}}

    • sector_id = {{$_GET.sector_id}}

    • product_reference_id = {{$_GET.product_reference_id}}

    • Several contains (LIKE) filters using GET parameters

  3. Ensure all conditions are optional (no required parameters)

  4. Execute the query with only one GET parameter

    • :cross_mark: No results returned
  5. Execute the same query with two or more GET parameters

    • :white_check_mark: Results returned
  6. Repeat the same steps in Wappler 7.4.1

    • :white_check_mark: Works correctly with a single parameter

Additional information

  • Backend: PHP

  • Database: MySQL

  • No query or validation errors are shown

  • Generated SQL combines all optional conditions using AND

  • Issue started immediately after upgrading to Wappler 7.6.1

  • Tested logic worked correctly in previous version

If needed, I can provide screenshots of the Query Builder configuration and the generated SQL.

After upgrading to Wappler 7.6.1, queries with multiple optional GET parameters only work when more than one condition is provided.
Using a single optional filter returns no results, while this worked correctly in 7.4.1 or previous (PHP/MySQL).

After further investigation, I found that the issue was not caused by a single file.

The behavior change with optional query parameters in Wappler 7.6.1 is caused by a chain of core files that work together during query evaluation.
Changes across these files caused missing GET parameters to be propagated as NULL, making optional filters behave as mandatory.

The files involved are:

lib/core/Parser.php

lib/core/Request.php

lib/core/Scope.php

lib/db/SqlBuilder.php

modules/dbconnector.php

Updating only part of this chain leads to inconsistent behavior, where optional parameters are still compiled into the WHERE clause.

This confirms that optional query behavior depends on a consistent internal chain:

Parser → Scope → Request → SqlBuilder → dbconnector

Mixing versions inside this chain causes optional parameters to be treated as NULL and included in the query logic, silently changing query behavior and impacting existing projects.

The issue is caused by changes across multiple core files (Parser, Request, Scope, SqlBuilder, and dbconnector), not a single one.
The new behavior silently changes how optional parameters are handled, which can break existing projects.

Please post a screenshot of your database query conditions, so we can see what you're doing there.

In previous Wappler versions, empty select values (including 0) were treated as empty and ignored in optional filters.
In newer versions, 0 is treated as a valid value, causing optional filters to be applied as field = 0 and silently breaking existing queries.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.