[BUG]: strange getListQuery code when using WHERE IN statement #1181
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1181
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Happened?
I created a dynamic get of the type getListQuery where I pulled data from a database table. Under tweak, I added a WHERE statement: a.discount_type IN (1,2). See screenshot.
This produced a rather strange and invalid piece of code:
To me this looks like a bug, as I was only expecting to see $query->where('a.discount_type IN (1,2)'); in code, but Im unsure if I use JCB as intended in this case? It works fine if I just set a.discount_type equal to e.g. 1. or greater than 0. But IN and NOT IN are giving me issues.
Steps to reproduce the Bug
Create a WHERE IN tweak in a getListQuery dynamic get as described above.
Which Joomla version are you compiling in?
5.2 rc2
Which PHP version are you compiling in?
8.1
Which Joomla versions are you targeting?
v5
Which PHP version are you targeting?
8.1
Which Web server is JCB running on?
Apache 2.4
Which Relational Database is JCB running on?
MariaDB
Which OS is JCB running on?
Ubuntu 20.04
Which JCB version are you using?
5.0.4-alpha3
Where in JCB did this issue occur?
Dynamic Get(admin_view)
On which browsers did you encounter the issue?
Safari
Additional Comments
No response
Note the note in the field:
User an array variable instead that you set in the before query (custom PHP area) or use a database
a.field
ref, you can not place text directly into that field for now...The custom PHP area:
Thank you Llewellyn, I got it working with your help.