Get permalink is not working fine

Home Forums Calendar Products Community Events Get permalink is not working fine

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #968246
    Pablo
    Participant

    Dear supporters,

    I have found several places around the plugin where I don’t get displayed properly the permalink of a post. I need to call the function at least twice to get the proper value.

    One use case where I find this mistake is:

    1. I create a recurrent event (every day during a week).
    2. I go to edit (all) the event and I change the title.
    3. At the moment you click in update button and you got the message of View event | Edit event => The view event is not correct (it returns the same page where you are).


    $view_link = sprintf('%s', esc_url( get_permalink($event_id) ), __('View', 'tribe-events-community'));

    That is the piece of the code. The “get_permalink” function behaves unpredictably, and you need to call it a second time to get the expected result.

    I have solved the problem in these templates I can control, but that is not one of them, since that piece of code is inside tribe-community-events.php

    Could it be a bug?

    Thanks in advance,

    #968332
    Brian
    Keymaster

    Hi,

    Sorry for the issues you are having.

    Are you having this issue on the front end with the community event form?

    Let me know and I can work with you to figure this out.

    Thanks

    #968354
    Pablo
    Participant

    Hello Brian,

    Yes, I am having the issues on the front end.

    Regards,

    Pablo

    #968411
    Brian
    Keymaster

    Ok Thanks.

    I tested out on my site and was not able to reproduce the error.

    After you edit the recurring event title, what is the link for the View Event?

    Can you right click and copy the link.

    It should look something like this:

    http://yoursite.com/?post_type=tribe_events&p=228

    Let me know.

    Thanks

    #968416
    Pablo
    Participant

    Hei Brian,

    The permalink function returns nothing, so the href=”” (it means the current edition event page).

    It does not happen the first time that you create the event… but it happens the second time (it is no very predictable).

    Other place where I am able to reproduce the error is on the event-list.php. The view link of every event is incorrect for the same reason… the permalink returns nothing on the first time is called inside the loop. So I need to call one first time (dummy) and then it works.

    Can you reproduce this last one?

    Thanks for your help!

    #968474
    Brian
    Keymaster

    Hi,

    I am not seeing any issues on my sites with get_permalink().

    That is a WordPress function and if it breaking down there could be something with the WordPress Install, the theme, or a plugin conflict.

    Can you follow our testing for conflicts guide:

    https://theeventscalendar.com/knowledgebase/testing-for-conflicts/

    And see if that helps narrow down the source of this.

    Thanks

    #968627
    Pablo
    Participant

    Hello Brian,

    I followed the recommendations and you were right. The translation plugin that I use does not live well with TEC…

    Thanks a lot for your advise!

    Regards,

    Pablo

    #968730
    Brian
    Keymaster

    I am glad to see you were able to fix this issue.

    Unfortunately, at this time plugins such as WPML do not work well with our plugins. It is something we are looking to fix, but I do not have a timeline when that might happen.

    Since the issue is resolved I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Get permalink is not working fine’ is closed to new replies.