Follow-up: Problem with tribe_get_past_link()

Home Forums Calendar Products Events Calendar PRO Follow-up: Problem with tribe_get_past_link()

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #951560
    Marty
    Participant

    Hi Josh et al,

    Regarding this thread:
    https://theeventscalendar.com/support/forums/topic/problem-with-tribe_get_past_link/#dl_post-950984

    We may have closed the thread prematurely. Having implemented the suggested change, I find that function is still not returning a working URL. With the change, tribe_get_past_link() returns:

    /events/category/mycategory/list/?tribe_event_display=past

    However, that URL results in the error “There are no upcoming events in this category.” It looks like the correct URL would be:

    /events/category/mycategory/?tribe_event_display=past

    (Note the removal of “list/”.) Or, with all the relevant params:

    /events/category/mycategory/?action=tribe_list&tribe_event_display=past&tribe_paged=1

    Thanks!

    #951564
    Marty
    Participant

    Speaking of, I’ve noticed tribe_get_listview_link() has a very similar problem. It returns:

    /events/category/mycategory/list/

    Which is resulting in the “There are no upcoming events in this category” message. It seems like what we’d really want to return here would be:

    /events/category/mycategory/?action=tribe_list

    As with tribe_get_past_link(), it appears to be including “list/” where it should not be.

    #951662
    George
    Participant

    Hey Marty,

    Sorry for the troubles here. I’m curious, if ?action=tribe_list would be best appended to your URLs, how do things work if you refer back to that original thread, and make the same URL adjustments in the code that Josh recommended – however, instead of replacing the original code he referenced with this:

    
    $eventUrl = esc_url_raw( add_query_arg( 'tribe_event_display', 'past', trailingslashit( $eventUrl . $this->listSlug ) ) );
    

    You replace it with this?

    
    $eventUrl = esc_url_raw( add_query_arg( 'action', 'tribe_list' ) );
    

    Let us know if this helps! 🙂

    — George

    #952017
    Marty
    Participant

    George et al,

    No, I’m sorry, that’s not working. What I’m getting, using it on Category list views, is simply a link to the page I’m already on.

    Big picture, it looks like when the URL scheme was changed from “/past/” to “?tribe_event_display=past” (not sure if that was 3.8 or 3.9), a bunch of functions were not properly updated, including tribe_get_past_link(), tribe_get_upcoming_link(), tribe_get_listview_link() and potentially others that I haven’t tested.

    If that’s the case, may I request that they be all be fixed and fully tested for 4.0? That way instead of doing all this back and forth now, I can go back to my client and say, “Hey, listen, 3.9 is no good. We need to hold out ’till 4.0, then update.” ‘Cause all this back and forth is way past what we budgeted for what was meant to be a routine plugin update.

    Please let me know if that’s a viable way forward. Thanks!

    #952801
    George
    Participant

    Hey Marty,

    I’m sorry about your continued trouble with getting things working – we indeed changed things coming into version 3.9, but changed those functions as well and things should work fine.

    I’m curious – what are the exact Permalink settings on your site?

    Thank you for being patient with this process so far, I’m confident we can get a working solution in place until the next major plugin update!

    — George

    #953176
    Marty
    Participant

    Here’s my test site. It’s a child theme of 2015 containing a copy of the /views/ material, modified to include var_dumps:

    http://test.martyspellerberg.com/events/category/mycategory/list/

    Permalinks are set to /%postname%/

    Thanks!

    #953209
    George
    Participant

    Hey Marty,

    I’m really sorry for the back-and-forth here, and your patience means a ton – thank you!

    I’m curious though, on your site both the Previous and Next Events links worked well for me. Do the links fail only on specific views or something?

    Again: thank you for your patience here. We’re determined to help and are just trying to get an exact picture of the situation here, URL-related problems can be extremely diverse.

    Thanks Marty,
    George

    #953301
    Marty
    Participant

    It’s not the links I’m asking about. I’m asking about the output of tribe_get_past_link(). It’s var_dump’d at the top and results in:

    http://test.martyspellerberg.com/events/category/mycategory/list?tribe_event_display=past/

    As you can see, that link returns “Upcoming Events.” The proper link to past events appears to be:

    http://test.martyspellerberg.com/events/category/mycategory/?tribe_event_display=past

    #953455
    George
    Participant

    Hey Marty,

    Thanks for your patience with the back-and-forth here. Just to be clear: you are confirming that the actual “Previous Events” and “Next Events” links work fine on your page then?

    If so, and if the only issue is simply the output of these separate template tags, then one thing to note is that this is indeed a bug we caught in the last release cycle and have a fix for in the next, fast-approaching release.

    If you’re in desperate need of working template tags here, would you be interested in having some of the modified code? You’d have to manually replace the existing template tags, a pain and not normally a good idea in any way, but it might help here.

    Thanks,
    George

    #953516
    Marty
    Participant

    Yes, my question is about API functions only. Please note that this thread is a follow-up to a previous thread:

    https://theeventscalendar.com/support/forums/topic/problem-with-tribe_get_past_link/

    And what I’m saying is that I wasn’t getting the proper result from the code from that previous thread. So could you please double-check that solution (which might be the patch slated for the next release?) and confirm it’s returning the correct result for you?

    Thanks!

    #953584
    George
    Participant

    Hi Marty,

    Thank you for clarifying things a bit – for me personally, both the default functions themselves and Josh’s solution get the proper results for me, but a known bug is that some people’s sites don’t get the correct result from those template tags.

    We’ve got an active fix in place – are you interested in manually replacing your versions of those template tags with new ones? Or is holding off for the next update and trying all this out again a workable option here?

    — George

    #955831
    Marty
    Participant

    Hi there. I’m working around this function and won’t be using it. So I’m marking this thread as closed, though as far as I know the bug persists. Thanks for your help.

    #956274
    George
    Participant

    Hey Marty,

    Thank you for your update – please stay tuned to the next major update, we’ve included some fixes for these very links and hopefully it will help your issues!

    Thanks for your patience with the issue earlier.

    Best of luck with your site!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Follow-up: Problem with tribe_get_past_link()’ is closed to new replies.