Dynamic Get Join View Tables wrong dbname #250

Closed
opened 2018-03-21 17:27:06 +00:00 by cpaschen · 2 comments
cpaschen commented 2018-03-21 17:27:06 +00:00 (Migrated from github.com)

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).

### 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 say jos_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

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 say `jos_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
ro-ot commented 2018-03-24 16:22:02 +00:00 (Migrated from github.com)

Assume issue is resolved due to no response.

Assume issue is resolved due to no response.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#250
No description provided.