Dynamic Get Join View Tables wrong dbname #250
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#250
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
Create Component 1 (Books)
Create an Admin View with fields (Editions)
Create Component 2 (Reviews)
Create Admin View on Reviews
One of the fields is a Custom field that selects one of the 'Editions' (based on Editions ID field)
Create Dynamic Get on the Reviews that has a JOINT link to the Editions table (from Books) using the ViewTable area.
Expected result
In the administrator/components/com_REVIEWS/models/VIEW.php file, in the getListQuery the query join to get the edition details should have:
$query->join('LEFT', ($db->quoteName('#__kr_books_books_edition', 'b')) ...
Actual result
$query->join('LEFT', ($db->quoteName('#__kr_books_reviews_edition', 'b')) ....
Additional comments
My guess is that this is due to the fact that the View Table area within the Dynamic Get Joint selection automatically builds the table name.
IF that is the case, then this is just a case that I should probably document - to make it clear that the "Join View Tables' will only work with tables that are part of the same component as the "Main" table for this Dynamic Get.
(Sorry if that seems obvious, but it wasn't to me).
Maybe an 'improvement' on the UI for JCB would be to only display tables in that drop-down that are already linked to the same component as the Main table (when we are using the Back-end View for the Main Source).
No we can not limit the dropdown to that of one component, because of the fact that this dynamicGet can literately be linked into any component.
DynamicGet can cross select even from none JCB tables and components in any verity of ways. I feel it is up to the developer to keep track of it all.
If you are only speaking about dynamicGet and not the admin list view, well then instead of using the Main Source->Back-end View, use the Main Source->Joomla Database option. Meaning that you install Create Component 1 (Books)->managebooks and in the dynamicGet select that actual Table in the DB, since then the name will be correct.
With the Back-end View selection it always uses the component name.
#__managebooks_edition
but with the database/table option if you select, lets sayjos_managereviews_edition
it will become#__managereviews_edition
which is the correct name in your case.So when the view is part of your component use Main Source->Back-end View, if not use Main Source->Joomla Database
Let me know if this helps
Assume issue is resolved due to no response.