• In the query being injected into WP_QUERY for the tag archive pages there is a bug. The queries add a date filter, which also is applied to posts of other types. With the effect that no content is found, or only events being shown on the tag archive page (Posts tagged with…).

    Also a “group_by” is added which effect is that only one archive entry is shown (frontend or backend). Please check for yourself if these changes are correct, they worked for us:

    File: event-organiser/includes/event-organiser-archives.php

    Function: eventorganiser_event_groupby( $groupby, $query )

    if (! is_admin()) {
    
    		if(!empty($query->query_vars['group_events_by']) && $query->query_vars['group_events_by'] == 'series'){
    			return "{$wpdb->eo_events}.post_id";
    		}
    
    		if( eventorganiser_is_event_query( $query ) ):
    			if(!empty($groupby))
    				return $groupby;
    
    			return "{$wpdb->eo_events}.event_id";
    		endif;
    	}
    
    	return $groupby;

    Function: eventorganiser_events_where( $where, $query )

    //Check date ranges were are interested in.
    		$date_queries = array(
    			'event_start_after'=>array(
    				'notstrict' =>" AND ({$wpdb->eo_events}.event_id IS NULL OR ({$wpdb->eo_events}.event_id IS NOT NULL AND {$wpdb->eo_events}.StartDate >= %s)) ",
    				'strict' => " AND ({$wpdb->eo_events}.event_id IS NULL OR ({$wpdb->eo_events}.event_id IS NOT NULL AND ({$wpdb->eo_events}.StartDate > %s OR ({$wpdb->eo_events}.StartDate = %s AND {$wpdb->eo_events}.StartTime > %s)))) "
    			),
    			'event_start_before'=>array(
    				'notstrict' =>" AND ({$wpdb->eo_events}.event_id IS NULL OR ({$wpdb->eo_events}.event_id IS NOT NULL AND {$wpdb->eo_events}.StartDate <= %s)) ",
    				'strict' => " AND ({$wpdb->eo_events}.event_id IS NULL OR ({$wpdb->eo_events}.event_id IS NOT NULL AND ({$wpdb->eo_events}.StartDate < %s OR ({$wpdb->eo_events}.StartDate = %s AND {$wpdb->eo_events}.StartTime < %s)))) "
    			),
    			'event_end_after'=>array(
    				'notstrict' =>" AND ({$wpdb->eo_events}.event_id IS NULL OR ({$wpdb->eo_events}.event_id IS NOT NULL AND {$wpdb->eo_events}.EndDate >= %s)) ",
    				'strict' => " AND ({$wpdb->eo_events}.event_id IS NULL OR ({$wpdb->eo_events}.event_id IS NOT NULL AND ({$wpdb->eo_events}.EndDate > %s OR ({$wpdb->eo_events}.EndDate = %s AND {$wpdb->eo_events}.FinishTime > %s)))) "
    			),
    			'event_end_before'=>array(
    				'notstrict' =>" AND ({$wpdb->eo_events}.event_id IS NULL OR ({$wpdb->eo_events}.event_id IS NOT NULL AND {$wpdb->eo_events}.EndDate <= %s)) ",
    				'strict' => " AND ({$wpdb->eo_events}.event_id IS NULL OR ({$wpdb->eo_events}.event_id IS NOT NULL AND ({$wpdb->eo_events}.EndDate < %s OR ({$wpdb->eo_events}.EndDate = %s AND {$wpdb->eo_events}.FinishTime < %s)))) "
    			)
    		);

    http://wordpress.org/extend/plugins/event-organiser/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter pillwax.software

    (@pillwaxsoftware)

    Update, the following makes it work also in the backend to correctly show all posts/pages and also events:

    Function: eventorganiser_event_groupby( $groupby, $query )

    global $wpdb;
    
    	if ( eventorganiser_is_event_query( $query ) ) {
    
    		if (!is_admin()) {
    			if(!empty($query->query_vars['group_events_by']) && $query->query_vars['group_events_by'] == 'series'){
    				return "{$wpdb->eo_events}.post_id";
    			}
    		}
    
    		if(!empty($groupby))
    			return $groupby;
    
    		return "{$wpdb->eo_events}.event_id";
    
    	}
    
    	return $groupby;
    Plugin Author Stephen Harris

    (@stephenharris)

    Thanks!

    I’ll be fixing this in 1.8.3!

    Plugin Author Stephen Harris

    (@stephenharris)

    pillwax.software, a question regarding admin side queries – which pages were broken by the recent changes (which you’ve fixed above?).

    In particular events should be grouped by post ID on the admin page…

    Plugin Author Stephen Harris

    (@stephenharris)

    1.8.3 will hopefully resolve this. The plug-in will only alter the WHERE, GROUP and ORDER part of the queries where the query is exclusively for events.

    So a query for a taxonomy which is shared between events and another post type will not allow for date queries.

    A query for a taxonomy that is registered only for events will.

    Plugin Author Stephen Harris

    (@stephenharris)

    See this ticket for information on changes due to be made in 1.8.3: https://github.com/stephenharris/Event-Organiser/issues/65 (if anyone wants to test it out, please do!)

    Thread Starter pillwax.software

    (@pillwaxsoftware)

    Hello Stephen,

    all Queries which list posts based on category or tag.
    Example: Goto the categories and use the link on the number of posts in that category. The resulting post list only showed some posts instead of all counted in the category (due to the GROUP_BY in the query).

    Same for tags.

    We like your plugin, and while implementing it we also appreciated the good code quality which is not always the case with open source software.
    That way we where also able to find out what to correct and provide that back to you as feedback.
    Thanks for your work and efforts, our client was stunned how your event calendar turned out on his site.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Tag Archive pages showing no content or only partial content’ is closed to new replies.