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

Not unique table/alias database error with The Events Calendar #52

Open
3 tasks done
dwanjuki opened this issue Aug 21, 2023 · 2 comments
Open
3 tasks done

Not unique table/alias database error with The Events Calendar #52

dwanjuki opened this issue Aug 21, 2023 · 2 comments

Comments

@dwanjuki
Copy link

Describe the bug
Visiting The Events Calendar's events page triggers the following database error WordPress database error: [Not unique table/alias: 'wp_tec_occurrences']

Related PR: #49

Not unique table/alias: 'wp_tests_tec_occurrences' for query SELECT SQL_CALC_FOUND_ROWS wp_tests_posts.ID FROM wp_tests_posts LEFT JOIN wp_tests_term_relationships ON (wp_tests_posts.ID = wp_tests_term_relationships.object_id) LEFT JOIN wp_tests_term_relationships AS tt1 ON (wp_tests_posts.ID = tt1.object_id) LEFT JOIN wp_tests_term_relationships AS tt2 ON (wp_tests_posts.ID = tt2.object_id) INNER JOIN wp_tests_tec_occurrences ON wp_tests_posts.ID = wp_tests_tec_occurrences.post_id LEFT JOIN `wp_tests_pmpro_memberships_pages` AS `pmpro_mp_5` ON `pmpro_mp_5`.`page_id` = `wp_tests_posts`.`ID` JOIN wp_tests_tec_occurrences ON wp_tests_posts.ID = wp_tests_tec_occurrences.post_id WHERE 1=1 AND wp_tests_posts.ID NOT IN (43,449,816,945,1509,43,449,816,945,1509) AND ( wp_tests_term_relationships.term_taxonomy_id IN (3) AND tt1.term_taxonomy_id IN (3) AND tt2.term_taxonomy_id IN (1,3,59,76,82,84,95) ) AND ( CAST(wp_tests_tec_occurrences.end_date AS DATETIME) < '2023-08-21 07:39:06' ) AND wp_tests_posts.post_type = 'tribe_events' AND ((wp_tests_posts.post_status = 'publish' OR wp_tests_posts.post_status = 'private')) AND (pmpro_mp_5.membership_id IS NULL OR pmpro_mp_5.membership_id IN ( 2 )) GROUP BY wp_tests_tec_occurrences.occurrence_id ORDER BY wp_tests_posts.post_date ASC LIMIT 0, 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/the-events-calendar/src/views/v2/default-template.php'), Tribe\Events\Views\V2\Template_Bootstrap->get_view_html, Tribe\Events\Views\V2\View->get_html, Tribe\Events\Views\V2\Views\List_View->setup_template_vars, Tribe\Events\Views\V2\View->setup_template_vars, Tribe\Events\Views\V2\Views\List_View->prev_url, Tribe\Events\Views\V2\Views\List_View->get_past_url, Tribe__Repository->count, WP_Query->get_posts, apply_filters_ref_array('posts_pre_query'), WP_Hook->apply_filters, TEC\Events\Custom_Tables\V1\WP_Query\Modifiers\Events_Only_Modifier->filter_posts_pre_query, TEC\Events\Custom_Tables\V1\WP_Query\Custom_Tables_Query->get_posts, WP_Query->get_posts

To Reproduce
Steps to reproduce the behavior:

  1. Activate PMPro, The Events Calendar, and the PMPro Events Add On.
  2. Visit the Events List page with debugging enabled.
  3. Check debug log, see error

Expected behavior
No errors

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

PHP 8.0.29 WordPress 6.3 PMPro 2.10.2 The Events Calendar 6.2.0.1 PMPro Events 1.4
@dwanjuki
Copy link
Author

Furthermore, when the Add On is active, no events are displayed on the Events archive page, or where the [tribe_events] shortcode is used.

@andrewlimaza
Copy link
Contributor

@dwanjuki please can you retest the Events archive page with the latest version. This issue seems to have been resolved on my end and I haven't been able to replicate it recently.

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