Dynamic Get - Join DB Tables - no views #251
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#251
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?
Steps to reproduce the issue
Try to add a table view (a view created within MySQL) to the Dynamic Get in the Join DB Tables area.
Expected result
Views should be listed along with tables
Actual result
No views are visible, just tables
System information (as much as possible)
Additional comments
It IS possible to link to views from Custom field types, but then they don't work properly when trying to display in a site view via a dynamic get because we can't link to them.
This is a little confusing, can you give a little more explanation, also some code and in what files you got them. There are so many words that can mean more then one thing. So with each of those, try to be more qualifying of the actual location, being very specific.
Sorry, this isn't related to 'code generated' but with the actual JCB UI in the Dynamic Get area.
Here are the steps that reproduce the problem:
PROBLEM
The view does not appear available in the drop-down list (only actual 'tables' appear).
Tested on mysql 5.5.x and 5.7.x with same results.
Also upgraded to JCB 2.7.0 with same results.
Okay the tables must have primary key (very important).
You will see that here line 150 of the dbtables.php field file.
When you are dealing with any field in JCB that is dynamic/custom you can look at how it works in this folder.
Assume issue is resolved due to no response.
I'm sorry that I didn't respond in a timely manner, but I needed time to look into the previous response.
In researching MySQL, according to the docs, if the underlying table has an index, then it is automatically available via the view.
In this case the table has several indexes as well as a index.
So I'm not sure exactly why the code is not 'seeing' the index.
Sorry, that is a bit above my understanding of dealing with MySQL.
Just curious if anyone else tried to test this? (By creating a view on a table that has an index and see if the table is displayed) to make sure it was just me and that there isn't some problem?
@cpaschen sure, I just did some house cleaning 🚶♂️
Ok he is not talking about
index
but prime key, prime keys is usually the id. The code that test for the prime key is what @Llewellynvdm pointed you to on line 160 you see it is basic sql statementHere you can see how to make a column prime.
This is important since we need a key that is going to be unique and the prime key is the only type of column that is always using that behavior.
Still having trouble, give me the mySql that you used to create the table, and I will test it.