Home › Forums › Calendar Products › Community Events › Get permalink is not working fine
- This topic has 7 replies, 2 voices, and was last updated 8 years, 11 months ago by Brian.
-
AuthorPosts
-
June 9, 2015 at 12:41 pm #968246PabloParticipant
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,
June 9, 2015 at 6:52 pm #968332BrianKeymasterHi,
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
June 9, 2015 at 10:41 pm #968354PabloParticipantHello Brian,
Yes, I am having the issues on the front end.
Regards,
Pablo
June 10, 2015 at 6:57 am #968411BrianKeymasterOk 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
June 10, 2015 at 7:06 am #968416PabloParticipantHei 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!
June 10, 2015 at 8:53 am #968474BrianKeymasterHi,
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
June 10, 2015 at 2:16 pm #968627PabloParticipantHello 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
June 11, 2015 at 5:45 am #968730BrianKeymasterI 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!
-
AuthorPosts
- The topic ‘Get permalink is not working fine’ is closed to new replies.