Skip to content

SQL Error in RedirectBundle when Searching for Redirects (PostgreSQL 15) #95

@KenoQF

Description

@KenoQF

System Information:

  • Sulu Version: 2.5.18
  • RedirectBundle Version: 2.1.4
  • PHP Version: 8.2.27
  • Database: PostgreSQL 15
  • Doctrine orm Version: ^2.5.3

Description:
When searching for redirects using the RedirectBundle, an SQL error occurs due to filtering a BOOLEAN field with LIKE. This issue appears to be related to PostgreSQL 15, which enforces stricter type checks.

Description:

`An exception occurred while executing a query: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: boolean ~~ unknown
LINE 1: ...t_routes r0_ WHERE (r0_.id LIKE $1 OR r0_.enabled LIKE $2 OR...
                                                             ^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.`

Steps to Reproduce:

  1. Use PostgreSQL 15 as the database
  2. Install Sulu with the RedirectBundle
  3. Search for redirects via Admin
  4. The error occurs because r0_.enabled (a BOOLEAN field) is being compared using LIKE

Expected Behavior:
The query should execute without errors. The search should be usable.

Possible Solutions:

  • Modify the query to avoid using LIKE on BOOLEAN fields
  • Explicitly cast BOOLEAN to TEXT in Doctrine (CAST(r.enabled AS TEXT))

Thanks for any help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions