SQL Exception InvalidFieldNameException [BUG] #93

Closed
opened 2022-02-07 14:07:52 +01:00 by toscharfmoc · 1 comment

Issue

Environment

  • Custom menu version: latest
  • Nextcloud version: 22.2.3
  • PHP version: 8.0.12
  • Web server (Nginx, Apache2): nginx
  • Web browser and version (Firefox 80, Google Chrome 74, etc): all
  • DB: MariaDB 10.5

Steps to reproduce

add to SQL_MODE="ANSI_QUOTES"
Open Custom Menu Settings results in:

Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'lang' in 'where clause'

Issue is caused by https://gitnet.fr/deblan/side_menu/src/branch/master/lib/Service/LangRepository.php
Line: 29
->where('configkey="lang" and appid="core" and configvalue<>"en"')

The issue could be fixed by switching the quotes to:
->where("configkey='lang' and appid='core' and configvalue<>'en'")

Unfortunately in my setup the database is managed externally and a change of the sql mode (which could also fix the issue) is not possible. It would be nice if the code could be adapted accordingly, as the use of single quotes for string literals is more in line with best practice.

## Issue ### Environment * Custom menu version: latest * Nextcloud version: 22.2.3 * PHP version: 8.0.12 * Web server (Nginx, Apache2): nginx * Web browser and version (Firefox 80, Google Chrome 74, etc): all * DB: MariaDB 10.5 ### Steps to reproduce add to SQL_MODE="ANSI_QUOTES" Open Custom Menu Settings results in: Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'lang' in 'where clause' Issue is caused by https://gitnet.fr/deblan/side_menu/src/branch/master/lib/Service/LangRepository.php Line: 29 ->where('configkey="lang" and appid="core" and configvalue<>"en"') The issue could be fixed by switching the quotes to: ->where("configkey='lang' and appid='core' and configvalue<>'en'") Unfortunately in my setup the database is managed externally and a change of the sql mode (which could also fix the issue) is not possible. It would be nice if the code could be adapted accordingly, as the use of single quotes for string literals is more in line with best practice.
toscharfmoc added the
bug
label 2022-02-07 14:07:52 +01:00
deblan added the
WIP
label 2022-02-07 14:23:09 +01:00
deblan removed the
WIP
label 2022-02-07 14:42:48 +01:00
Owner

Fixed in v2.3.3!

Fixed in v2.3.3!
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: deblan/side_menu#93
No description provided.