• Resolved KrishaWeb

    (@krishaweb)


    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 6 years, 8 months ago by KrishaWeb.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Anonymous User 14808221

    (@anonymized-14808221)

    Thanks @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/

    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

    (@krishaweb)

    Anonymous User 14808221

    (@anonymized-14808221)

    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)

    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.