Support

Home Forums Event Espresso Premium Database Error "Not unique table"

Database Error "Not unique table"

Posted: November 6, 2018 at 11:56 am

Viewing 1 reply thread


fishwinkmarketing

November 6, 2018 at 11:56 am

Version 4.9.69.p

I get this error when I do anything that trys to add or modify a query for espresso events.

For example if I use this filter:

EES_Espresso_Events__process_shortcode__default_espresso_events_shortcode_atts

To try to add either a “meta_query” ar “tax_query” to the default attributes, so that these query additions will be ran when querying events, I get the db error mentioned above.

//Here is an example of my tax query attribute that I pass to the filter. 

	$tax_query_args = array(
		array(
			'taxonomy'     => 'espresso_event_categories',
			'field'   => 'name',
			'terms' =>  array('SomeEventCategoryHERE')
		));
       $atts['tax_query'] = tax_query_args; 

This also happens if I filter the global query and interject my code there as well. This happens inside or outisde of the filter I posted above.

$wp_query->set( 'tax_query', $tax_query_args );

So it seems at the current time we are NOT able to add or modify to the query that queries espresso events?

It looks like this Github issue is similar, but it says it has been fixed.

https://github.com/eventespresso/event-espresso-core/pull/498


Josh

  • Support Staff

November 6, 2018 at 12:13 pm

Hi,

The filter hook
EES_Espresso_Events__process_shortcode__default_espresso_events_shortcode_atts

is for filtering shortcode attributes. If you’re trying to modify or add to the query, you can use native WP filter hooks like posts_where, posts_join, and so on. Here’s an example of that shows how from the code snippet library:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/de_ee_filter_events_out_with_expired_tickets.php

Viewing 1 reply thread

The support post ‘Database Error "Not unique table"’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso