[BUG]: DynamicGet "Where" ValueKey 0 won't add statement to the generated code. #1254

Closed
opened 2025-09-17 22:04:13 +00:00 by Tom van der Laan · 2 comments
Member

What Happened?

Hi,

I have a query like the image below:

Scherm­afbeelding 2025-09-18 om 00.01.54.png

But this is the generated code:

Scherm­afbeelding 2025-09-18 om 00.02.42.png

When i change the ValueKey to anything other than 0 it works fine.

Steps to reproduce the Bug

Add where clause to a dynamic get with check equal = 0.

Which Joomla version are you compiling in?

5.3

Which PHP version are you compiling in?

8.3

Which Joomla versions are you targeting?

5

Which PHP version are you targeting?

8.3

Which Web server is JCB running on?

litespeed

Which Relational Database is JCB running on?

10.11

Which OS is JCB running on?

almalinux 9

Which JCB version are you using?

5.1.2 beta 2

Where in JCB did this issue occur?

Dynamic Get(admin_view)

On which browsers did you encounter the issue?

Firefox

Additional Comments

No response

### What Happened? Hi, I have a query like the image below: ![Scherm­afbeelding 2025-09-18 om 00.01.54.png](/attachments/6b86ca2f-6b99-4e67-8ae7-bcf6ac77eb2f) But this is the generated code: ![Scherm­afbeelding 2025-09-18 om 00.02.42.png](/attachments/f0c5dcd7-979d-469c-b8eb-c112f6e12384) When i change the ValueKey to anything other than 0 it works fine. ### Steps to reproduce the Bug Add where clause to a dynamic get with check equal = 0. ### Which Joomla version are you compiling in? 5.3 ### Which PHP version are you compiling in? 8.3 ### Which Joomla versions are you targeting? 5 ### Which PHP version are you targeting? 8.3 ### Which Web server is JCB running on? litespeed ### Which Relational Database is JCB running on? 10.11 ### Which OS is JCB running on? almalinux 9 ### Which JCB version are you using? 5.1.2 beta 2 ### Where in JCB did this issue occur? Dynamic Get(admin_view) ### On which browsers did you encounter the issue? Firefox ### Additional Comments _No response_
Tom van der Laan added the Bug label 2025-09-17 22:04:13 +00:00
Author
Member

The issue is here:

c53260c6c7/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Dynamicget/QueryWhere.php (L92)

When i change the line to something like this:

			if (empty($whe['table_key']) || trim($whe['value_key']) == "")

it solves my issue of course.

The issue is here: https://git.vdm.dev/joomla/Component-Builder/src/commit/c53260c6c7097334d896aec7c0ebfcd3dbda9b41/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Dynamicget/QueryWhere.php#L92 When i change the line to something like this: ``` if (empty($whe['table_key']) || trim($whe['value_key']) == "") ``` it solves my issue of course.
Robot referenced this issue from a commit 2025-09-19 14:41:44 +00:00
Robot referenced this issue from a commit 2025-09-19 14:55:03 +00:00
Robot referenced this issue from a commit 2025-09-19 15:03:26 +00:00
Owner

I can confirm that this issue has been fixed with the Release of v5.1.2-beta3.

In my Dynamic Get:
image1.png

In the JCB Generated Code:
image2.png

This issue can be closed.

I can confirm that this issue has been fixed with the [Release of v5.1.2-beta3](https://git.vdm.dev/joomla/Component-Builder/commit/c0675818f7557eba8890385036b68569ff327df4). In my Dynamic Get: ![image1.png](https://git.vdm.dev/attachments/a4ac8439-46de-42fb-94e2-3a502355ad99) In the JCB Generated Code: ![image2.png](https://git.vdm.dev/attachments/0c55ed6c-c905-48c0-9ed8-f4c384d43480) This issue can be closed.
Robot referenced this issue from a commit 2025-10-15 20:35:52 +00:00
Robot referenced this issue from a commit 2025-10-15 20:57:03 +00:00
Robot referenced this issue from a commit 2025-10-15 21:07:33 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1254