Skip to content

SPACE-GE-% causes PostgreSQL error "column does not exist" in SpaceMapper.php #1626

@binch31

Description

@binch31

Description:
Bug description:
When using Workspace 4.2.0 with PostgreSQL, the workspace list fails to load with the error:
SQLSTATE[42703]: Undefined column: ERROR: column "SPACE-GE-%" does not exist
Environment:

Workspace version: 4.2.0
Nextcloud version: 31.0.12
Database: PostgreSQL
PHP version: 8.x

Root cause:
In lib/Db/SpaceMapper.php (lines 102 and 213), the LIKE condition uses double quotes around the string value:

'gu.gid like "SPACE-GE-%"'

PostgreSQL interprets double quotes as column/table identifiers, not string literals. This works on MySQL but fails on PostgreSQL.
Fix applied:
Replace both occurrences with a proper parameterized query:

$qb->expr()->like('gu.gid', $qb->createNamedParameter('SPACE-GE-%'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions