Title: Table prefix in table_join_manager file
Last modified: July 2, 2018

---

# Table prefix in table_join_manager file

 *  Resolved [KrishaWeb](https://wordpress.org/support/users/krishaweb/)
 * (@krishaweb)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/table-prefix-in-table_join_manager-file/)
 * Hello
 * In the types/vendor/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/
   table_join_manager.php file database table prefix is set to by default(**wp_**).
   If there is a change in database table prefix then this is creating issues. Please
   check and update it.
 *     ```
       return $this->wpdb->prepare(
       	"JOIN {$this->table_name->association_table()} AS {$associations_table_alias} ON (
       		wp_posts.ID = {$associations_table_alias}.{$role_to_return_id_column}
       		AND {$associations_table_alias}.relationship_id = %d
       		AND {$associations_table_alias}.{$role_to_query_by_id_column} = %d
       	) ",
       	$relationship_id,
       	$element_to_query_by
       );
       ```
   
 *     ```
       $clause = $this->wpdb->prepare(
       "
       # join the icl_translations table independently from WPML's 't'
       # because that one may not be joined at all time, but we 
       # need it always - this is safer than trying to reuse the 't' one
       LEFT JOIN {$this->wpml_service->icl_translations_table_name()} AS {$alias_translation} ON (
       	wp_posts.ID = {$alias_translation}.element_id
       	AND {$alias_translation}.element_type = CONCAT('post_', wp_posts.post_type)
       ) LEFT JOIN {$this->wpml_service->icl_translations_table_name()} AS {$alias_default_lang} ON (
           {$alias_translation}.trid = {$alias_default_lang}.trid
           AND {$alias_default_lang}.language_code = %s
       ) JOIN {$this->table_name->association_table()} AS {$associations_table_alias} ON (
       	(
       		# join the association row if either the post ID matches the
       		# proper column in the associations table or if the ID of the default
       		# language version of the post matches it
       		wp_posts.ID = {$associations_table_alias}.{$role_to_return_column}
       		OR {$alias_default_lang}.element_id = {$associations_table_alias}.{$role_to_return_column}
       	)
       	AND {$associations_table_alias}.relationship_id = %d
       	AND {$associations_table_alias}.{$role_to_query_by_column} = %d
       )",
       $this->wpml_service->get_default_language(),
       $relationship_id,
       $element_to_query_by
       );
       ```
   
 * There are other occurences of it as well.
 * Thanks in advance
    -  This topic was modified 8 years, 1 month ago by [KrishaWeb](https://wordpress.org/support/users/krishaweb/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Anonymous User 14808221
 * (@anonymized-14808221)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/table-prefix-in-table_join_manager-file/#post-10464217)
 * Thanks [@krishaweb](https://wordpress.org/support/users/krishaweb/), but AFAIK,
   this code dopes not belong to Types as it is available here for free, instead,
   it is from the new Many To Many Relationship releases (3.xx) which are not free.
 * However, the BUG you reported, is already addressed, I think, Here:
    [https://toolset.com/forums/topic/new-wp_query-toolset_relationships-argument-is-not-returning-results/](https://toolset.com/forums/topic/new-wp_query-toolset_relationships-argument-is-not-returning-results/)
 * But that update is not pushed to the free Types, as the free Types works with
   the Legacy relationships only.
 * Please let me know if I missed a detail.
 * Thanks!
 *  Thread Starter [KrishaWeb](https://wordpress.org/support/users/krishaweb/)
 * (@krishaweb)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/table-prefix-in-table_join_manager-file/#post-10464272)
 * Hello Beda
 * I checked free version. Here is the link of the svn repo of the file.
    [https://plugins.svn.wordpress.org/types/trunk/vendor/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/table_join_manager.php](https://plugins.svn.wordpress.org/types/trunk/vendor/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/table_join_manager.php)
 * Thanks
 *  Anonymous User 14808221
 * (@anonymized-14808221)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/table-prefix-in-table_join_manager-file/#post-10468160)
 * Let me check this with the Developers.
    You may find code that belongs to the
   new features in older Types releases already, but that would just be preparation
   to the 3.x releases which the Free Types did not receive (and hence, that code
   won’t be used)
 * But let me make sure this is a false alarm with the Developers, otherwise we 
   will logically push the same fix as we pushed for 3.x as well to the Free versions(
   in case the code is used)
 *  Anonymous User 14808221
 * (@anonymized-14808221)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/table-prefix-in-table_join_manager-file/#post-10479026)
 * So, I just confirmed this with the Developer, the file where that issue is present(
   the entire code) is not used at all in the Free Version. It is not something 
   you need to worry about.
 * The Code affected and solved by the Bug is used only if you use the 3.x versions.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Table prefix in table_join_manager file’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: Anonymous User 14808221
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/table-prefix-in-table_join_manager-file/#post-10479026)
 * Status: resolved