[BUG]: Dynamic get Join on DB table hardcodes database prefix in getListQuery #1314

Closed
opened 2026-06-30 15:33:51 +00:00 by SimonvanDoorne · 2 comments
Member

What Happened?

When creating a dynamic get with a join on 'DB tables', the table prefix is hardcoded in the dropdown.
afbeelding.png
This results in the prefix being inserted into the 'getListQuery' function and crashing since the '#__' prefix is also applied.
afbeelding.png

Steps to reproduce the Bug

  1. Create Dynamic get
  2. Select join -> DB tables to any table
  3. Compile and install
  4. 500 error 'Table {dbname}.{prefix}_{prefix}_users does not exist

Which Joomla version are you compiling in?

5.4.3

Which PHP version are you compiling in?

8.1

Which Joomla versions are you targeting?

5.4.3

Which PHP version are you targeting?

8.1

Which Web server is JCB running on?

Ubuntu

Which Relational Database is JCB running on?

MariaDB

Which OS is JCB running on?

Ubuntu

Which JCB version are you using?

5.1.6 stable

Where in JCB did this issue occur?

Compilation of a component

On which browsers did you encounter the issue?

Firefox

Additional Comments

No response

### What Happened? When creating a dynamic get with a join on 'DB tables', the table prefix is hardcoded in the dropdown. ![afbeelding.png](/attachments/160322e3-3129-4634-b794-6c1288375e4b) This results in the prefix being inserted into the 'getListQuery' function and crashing since the '#__' prefix is also applied. ![afbeelding.png](/attachments/e13f9a14-afdd-4b24-988f-f010fb96db10) ### Steps to reproduce the Bug 1) Create Dynamic get 2) Select join -> DB tables to any table 3) Compile and install 4) 500 error 'Table {dbname}.{prefix}_{prefix}_users does not exist ### Which Joomla version are you compiling in? 5.4.3 ### Which PHP version are you compiling in? 8.1 ### Which Joomla versions are you targeting? 5.4.3 ### Which PHP version are you targeting? 8.1 ### Which Web server is JCB running on? Ubuntu ### Which Relational Database is JCB running on? MariaDB ### Which OS is JCB running on? Ubuntu ### Which JCB version are you using? 5.1.6 stable ### Where in JCB did this issue occur? Compilation of a component ### On which browsers did you encounter the issue? Firefox ### Additional Comments _No response_
SimonvanDoorne added the Bug label 2026-06-30 15:33:51 +00:00
Owner

@SimonvanDoorne I've reviewed this issue you've raised and here is my setup:

Join value in the Dynamic Get (getListQuery)
image.png
Generated code in the getListQuery
image.png

Seems to me there is a missing table in your setup because this setup I'm showing here is working perfectly and I'm getting no errors.

But when I change the #__demo_detail to some thing that does not exist eg. #__123demo_detail I get the error you're encountering.
image.png

@SimonvanDoorne I've reviewed this issue you've raised and here is my setup: Join value in the Dynamic Get (getListQuery) ![image.png](https://git.vdm.dev/attachments/b70b2e1c-fbb9-4c33-aef7-f2795a640ac6) Generated code in the `getListQuery` ![image.png](https://git.vdm.dev/attachments/559430af-765a-46f3-b513-13e5e3ca418b) Seems to me there is a missing table in your setup because this setup I'm showing here is working perfectly and I'm getting no errors. But when I change the `#__demo_detail` to some thing that does not exist eg. `#__123demo_detail` I get the error you're encountering. ![image.png](https://git.vdm.dev/attachments/c345495c-f91e-4609-94a5-1b240999df93)
Author
Member

Thanks to your testing i have now found my mistake. There are 2 Joomla instances installed on the same database. Site 1 runs JCB and site 2 is for some testing purposes. I realise now that i selected the join DB on site 2, so my original 'recipie' is wrong. It works correctly when selecting any table from site 1, but does not work with any selection of site 2. Closing the ticket since it seems like user error :).

Thanks to your testing i have now found my mistake. There are 2 Joomla instances installed on the same database. Site 1 runs JCB and site 2 is for some testing purposes. I realise now that i selected the join DB on site 2, so my original 'recipie' is wrong. It works correctly when selecting any table from site 1, but does not work with any selection of site 2. Closing the ticket since it seems like user error :).
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1314