Update Blues. After update, permalinks and tribe_get_event_link() are busted

Home Forums Calendar Products Events Calendar PRO Update Blues. After update, permalinks and tribe_get_event_link() are busted

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1058950
    Simon
    Participant

    So I’ve updated wordpress, my commercial theme, and a bunch of plugins including TEC on a site that we maintain here.

    When the site was built, I implemented these functions in functions.php https://theeventscalendar.com/knowledgebase/renaming-views/ to rename ‘month’ view to ‘Calendar’ and ‘list’ to ‘All events’.

    After the update, the views have remained renamed in the backend, but on the front-end the expected URL’s end up as 404’s. eg: events/calendar 404’s, events/month works. I suspect those functions listed in the KB may now be invalidated?

    I tried flushing the permalinks, by visiting settings/permalinks but got nothing

    In TEC’s settings I have the single event slug set as ‘event’.

    Wherever I was useing tribe_get_event_link() in my layouts, the resulting link is now $siteURL/tribe-event/$eventName after the update.

    At first, this was resulting in a 404, but now seems to get to the expected page. This is annoying as /event is how links have been passed around over facebook etc. It also means that the ‘single event URL’ setting seems to be ignored.

    Immediately after update I could get to events by manually typing in /event/$eventName, but now that 404’s…

    It seemed like it could be an issue with permalinks not being flushed, but after flushing by visiting settings/permalinks multiple times, the issue persists.

    Changing theme/deactivating plugins had no effect.

    Ideas?

    Thanks!

    #1059493
    Barry
    Member

    Hi Simon,

    The code inside The Events Calendar used to register rewrite rules was recently rewritten, so it may be that the second half of that knowledgebase post needs to be updated – and I’ve flagged it for further review accordingly.

    Until such time as we can update it, perhaps you could use a suitable redirect plugin to avoid problems for those users who are following the currently-invalid URLs?

    In TEC’s settings I have the single event slug set as ‘event’.

    Wherever I was useing tribe_get_event_link() in my layouts, the resulting link is now $siteURL/tribe-event/$eventName after the update.

    That sounds rather strange. Can you give me an example usage from your custom templates so I can try to replicate (and can you determine if this relates to the rewrite customizations you had implemented)?

    Last but not least, could you share your system information by private reply? Sometimes that can provide useful insights.

    #1059504
    Simon
    Participant

    so it may be that the second half of that knowledgebase post needs to be updated – and I’ve flagged it for further review accordingly.

    Thanks! Appreciate it :).

    you could use a suitable redirect plugin to avoid problems for those users who are following the currently-invalid URLs

    We held off updating until a period where there’s not really many events running, so it’s not a huge issue to leave the site slightly wonky for a bit. For this reason I’m going to leave redirects out of place for now – less to undo later.

    Example of tribe_get_event_link() acting weird: There’s actually only one place in the template I’ve called it directly, which is the home page just under the main image. It lives within a function in functions.php and (while it’s pretty inelegant) it doesn’t relate to rewrite customisations.

    function custom_widget_featured_image() {
    	global $post;
    	if( is_front_page() )
    	{
    	//img
    	/*echo tribe_event_featured_image( $post->ID, 'large' );*/
    	$box_image_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
    	echo('<a href="' . esc_url( tribe_get_event_link() ) . '" title="' . get_the_title( $post_id ) . '">');
    	
    	echo('<div class="middle box" style="background-image:url('.$box_image_src[0].')">');	
    			
    	//meta
    	$microformatStartFormat_year   = tribe_get_start_date( $event, false, 'Y' );
    	$microformatStartFormat_month   = tribe_get_start_date( $event, false, 'M' );
    	$microformatStartFormat_day   = tribe_get_start_date( $event, false, 'd' );
    	echo ('<p class="p-meta-2"><span>' . $microformatStartFormat_day . '</span><span>' . $microformatStartFormat_month . '</span><span>' . $microformatStartFormat_year . '</span></p>');
    	echo('</div>');
    	echo('</a>');
    	};
    }
    add_action( 'tribe_events_list_widget_before_the_event_title', 'custom_widget_featured_image' );

    Additionally, when the events are listed at /events and /events/month, they’re using pretty much the stock TEC templates and they’re spitting out /tribe-events/ in the URL string there too. eg, from /%theme-child%/tribe-events/pro/photo/single-event.php:

    <!-- Event Title -->
    		<?php do_action( 'tribe_events_before_the_event_title' ); ?>
    		<h2 class="tribe-events-list-event-title entry-title summary">
    			<a class="url" href="<?php echo esc_url( tribe_get_event_link() ); ?>" title="<?php the_title() ?>" rel="bookmark">
    				<?php the_title(); ?>
    			</a>
    		</h2>
    		<?php do_action( 'tribe_events_after_the_event_title' ); ?>
    

    I’ll reply in a moment with some system info/login ;). Thanks guys.

    • This reply was modified 8 years, 3 months ago by Simon.
    #1059507
    Simon
    Participant

    This reply is private.

    #1059543
    Barry
    Member

    Thank you, though I’m afraid we’re not permitted to login to the admin environments of customer sites.

    Can you share your system information?

    #1059550
    Simon
    Participant

    This reply is private.

    #1059589
    Barry
    Member

    Thanks!

    Unfortunately, nothing obvious is jumping out at me there.

    Are you or have you been able to follow our standard troubleshooting steps and see if the problem persists with nothing but our plugins and an unmodified, default theme in place?

    I realize you noted having run through these steps when you first created the support topic, but occasionally people check those fields by accident so I wanted to double check on this.

    Also, if after stripping things down to this point you noticed no difference, it could be worth trying again and flushing permalinks (by visiting Settings &rarr Permalinks) before moving on and reactivating everything.

    Could we give that a try?

    Thanks!

    #1059597
    Simon
    Participant

    Woah, that’s something. As you noted, I had changed theme/deactivated all plugins, but hadn’t flushed in between.

    I spun up a clone of the site so I could go through one by one deactivating plugins and flushing permalinks without wonkifying the front-facing site – turns out the PODS plugin was the issue! Once that was deactivated and flushed, then it was fine :). Re-activated PODS without issue. Did this on the live site and it’s fine there too – resolved!

    the link to /calendar is still problematic, but like you say, it’ll probably be a result of updating the KB article to keep up with changes in the core :).

    thanks Baz, you’re a champ! Sorry it ended up being so goose-chase-y!

    • This reply was modified 8 years, 3 months ago by Simon.
    #1059598
    Simon
    Participant

    Marking resolved.

    #1059609
    Barry
    Member

    Awesome, glad things worked out – and yep we’ll get that knowledgebase article updated 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Update Blues. After update, permalinks and tribe_get_event_link() are busted’ is closed to new replies.