Help Desk

issue with "view all events" link on future months

  • Posts: 2 Topics: 3
    | Permalink

    Hi there-
    We’ve noticed on our website that the “view more events” link in calendar view doesn’t work as expected for future months.

    To reproduce:
    – Go to http://marchonnewmexico.com/home/calendar/
    – Notice that the “view more events” link looks like this for December http://marchonnewmexico.com/events/2017-12-02/
    – Click the January and then February links at the bottom right hand corner of the page so you arrive here http://marchonnewmexico.com/home/calendar/?tribe-bar-date=2018-02
    – Then on Feb 6, click “view all 4 events” (http://marchonnewmexico.com/home/calendar/?date=2018-02-06&tribe_event_display=month)
    – Result: The user navigates back to the main calendar page rather than the page with all of the events for the day
    – Expected: The link should look something like this http://marchonnewmexico.com/events/2018-02-06/ where I see all the events for the day.

    Is there some kind of configuration I need to change to fix this?

    Thank you!

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Hi there Suzanne,

    Unfortunately, you’ve hit up against what appears to be a bug with our embedded view (ie, where you use the [tribe_events] shortcode). I’ll file a bug report for this and we’ll drop an update in here once we’ve got some news to share with you.

    In the meantime, if you feel comfortable doing so, please try adding the following code either to a custom plugin (preferred) or else to your theme’s functions.php file:

    /**
     * Ensure that month view 'view all X events' on this day links are functional.
     *
     * This is a temporary workaround for a bug in Events Calendar PRO 4.4.20.1.
     */
    add_filter( 'tribe_get_day_link', function( $url, $date ) {
        // Intervention is only needed following navigation by ajax
        if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
            return $url;
        }
    
        // Sanity check: only intervene if we have a valid date to work with
        if ( ! preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $date ) ) {
            return $url;
        }
    
        // Ensure the expected view parameters are in place
        $view_params = [
            'tribe-bar-date' => $date,
            'tribe_event_display' => 'day'
        ];
    
        return add_query_arg( $view_params, $url );
    }, 10, 2 );

    This will hopefully provide you with temporary relief from the problem.

    Posts: 2 Topics: 3
    | Permalink

    Hi Barry –
    I really appreciate your help! That worked perfectly.

    Thank you again,
    Suzanne

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Fantastic, glad that helped 🙂

    I’m going to set the status of this topic to ‘pending fix’ and, as soon as we are able to ship a substantive fix in a future release of the plugin, we’ll post an update in here (so you can remove the customization).

    Thanks again for your support and patience with this.

    Posts: 24 Topics: 1
    | Permalink

    Has there been a fix to this issue?

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Not yet I’m afraid, John.

    We’ve linked the bug report to this ticket though and as soon as the fix is available, we’ll post an update in here. In the meantime, the best course of action if you need a solution in the interim is to set up the snippet above.

    I hope that helps 🙂

    Posts: 24 Topics: 1
    | Permalink

    Thanks for the quick response. We set up the snippet above, but unfortunately, it did not help. We look forward to getting this issue resolved.

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Absolutely.

    As noted above, we’ll post an update in here as soon as the fix is ready.

    If you need further help before then, please do create a fresh ticket of your own (so you can share further information that might help us to craft a workaround – though, unfortunately, that isn’t always possible).

    Thanks for your patience in the meantime.