Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting and filtering Query error in combination with WPML #577

Closed
DGStefan opened this issue Jul 28, 2016 · 0 comments
Closed

Sorting and filtering Query error in combination with WPML #577

DGStefan opened this issue Jul 28, 2016 · 0 comments
Assignees
Milestone

Comments

@DGStefan
Copy link
Member

DGStefan commented Jul 28, 2016

Helpscout ticket #2751

After using filtering no results are shown with WPML active.
Query Monitor give the following DB Query

Not unique table/alias: 'test_postmeta' Query->
SELECT DISTINCT test_posts.* FROM test_posts INNER JOIN test_postmeta ON ( test_posts.ID = test_postmeta.post_id ) LEFT JOIN test_postmeta ON test_posts.ID = test_postmeta.post_id JOIN test_icl_translations t ON test_posts.ID = t.element_id AND t.element_type = CONCAT('post_', test_posts.post_type) WHERE 1=1 AND ( ( ( ( test_postmeta.meta_key = 'estate_property_price' AND CAST(test_postmeta.meta_value AS SIGNED) >= '60123456' ) ) ) ) AND test_posts.post_type = 'property' AND (test_posts.post_status = 'publish' OR test_posts.post_status = 'archive' OR test_posts.post_status = 'acf-disabled' OR test_posts.post_status = 'future' OR test_posts.post_status = 'draft' OR test_posts.post_status = 'pending' OR test_posts.post_status = 'private') AND ( ( t.language_code = 'pt-pt' AND test_posts.post_type IN ('post','page','acf-field-group','acf-field','property','testimonial' ) ) OR test_posts.post_type NOT IN ('post','page','acf-field-group','acf-field','property','testimonial' ) ) GROUP BY test_posts.ID ORDER BY test_posts.post_date DESC WP_Query->get_posts()

File

wp-includes/query.php:3613 WP_Query->query() wp-includes/query.php:4006 WP->query_posts() wp-includes/class-wp.php:608 WP->main() wp-includes/class-wp.php:726 wp() wp-includes/functions.php:952 wp_edit_posts_query() wp-admin/includes/post.php:1070 WP_Posts_List_Table->prepare_items() wp-admin/includes/class-wp-posts-list-table.php:142 Core Not unique table/alias: 'test_postmeta'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants