Issue with "preview" button when events cal pro is activated

Home Forums Calendar Products Events Calendar PRO Issue with "preview" button when events cal pro is activated

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #1005851
    Brendyn Montgomery
    Participant

    When you click on preview button in a draft event you get redirected to the home page instead of the event.

    When you first create a new event the permalink is broken too.

    Suspecting permalink issues, I’ve tried reseting the permalinks. This fixes the link issue but not the preview button issue. old events are totally fine. This is a new issue, we just moved the site to a new server about a week ago. Before that everything was working as it should.

    I’ve tried disabling all the plugins but that didn’t fix anything (bar the events calendar and events cal pro). Disabling events calendar pro fixes the issue with all other plugins enabled or disabled. Seems that the issue is with events calendar pro.

    This only effects events – it is working correctly on posts and pages.

    #1005956
    Jan
    Participant

    I have about the same problem with a custom post type.

    The preview button leads to something that would be correct if I wanted to make a preview of the frontpage.

    When I save the post type, it acts like the front page. That has lead the “redirection” plugin to notice an URL change and put an 301 to the page.

    I noticed, that no GUID is set for that custom post type. No, incorrect: The GUID is set to the front page = root URL of my page.

    As the GUID is the front page and the preview is built of the frontpage I would guess that the URL of the page is (at least for some time) handled like the front page, and saved like the front page.

    After publishing it, it is reachable through the URL like planed.

    My problem is directly connected with the Events Pro Plugin.
    It’s only there if the Events Pro is activated. It’s not there, when Events Pro is deactivated.

    All the other Events Calendar Plugins and all other plugins have no effect on the problem.

    I am very willing to help finding the problem.
    I need my custom post type, I need noobs to be able to create such posts and I want to use Calendar Pro (as it is nice and I have payed for it).

    I will have a look in the code myself but expect the team to help with it.
    If you have some suggestion what to check out, test etc. Or if you are interested in my specific code – I am ready to help

    #1006057
    Nico
    Member

    Hi @avocadesign and Jan,

    Thanks both for reaching out to us on this, and sorry for the inconvenience this might be causing to you 🙁

    Unfortunately this is something that has been reported by other customer as well, and further testing on our side confirmed this is a bug. It’s logged into our product backlog and a fix for this should be included in the upcoming version of the plugin. Due to time pressures and since it’s not a critical bug -we know it can be annoying but it won’t break your site- the fix won’t make it to the maintenance release coming out, hopefully next week.

    Do you think you can hold on for the fix? Next release is scheduled to be out early November -this is an approximate date-, in the meantime if this is really important for you I would recommend downgrading to a previous version of the calendar: Downgrading a plugin to a past version. Hope this is not to critical for you though!

    Please let me know if there’s anything else I can do for you,
    Best,
    Nico

    #1006059
    Nico
    Member

    If you have some suggestion what to check out, test etc. Or if you are interested in my specific code – I am ready to help

    Thanks a ton Jan, we usually put out the release candidates for testing before they ship, you are welcome to test this when the moment comes. 🙂

    #1006083
    Jan
    Participant

    Hm – this bug broke our site when the plugin was coupled with “redirection”.
    I guess that might also happen for other users who have less technical skills than I have (and I had to search for some hour because of the combination of things).

    I will deactivate ‘Events Calendar Pro’ till there is an update, I guess.

    What would I buy by downgrade? Have there been security fixes in the update or only new functionality? Would be a pain to open a security whole that has been fixed through downgrade.

    Do you have some first ideas what could cause the problem? I would be willing to put some effort in this and maybe there would be a possibility to ship a fix for the people who make their way to the forum.

    I guess the broken preview is only an symptom and not the root of the problem.

    As I recognized, the bug causes trouble with the ‘guid’ – so the feed is damaged because ‘guid’s are not unique.

    #1006085
    Jan
    Participant

    …the version of Event Calendar Pro bought is the most recent version.
    So I am not able to downgrade – there is no other version available for me in the download section of my profile.

    Is there a way to make (one) older verison(s) available for me?

    #1006193
    Brendyn Montgomery
    Participant

    While the site is not broken as you say, This is a critical bug for the client, a busy theatre in town. They put up new shows and then use the preview functionality to have other members of staff check the entries before publishing the event live on the site.

    I can’t disable events cal pro because they run recurring events and also use the photo view. I’ll have to down grade them if the fix won’t appear before Nov – that’s ages for them, they’ll have to publish about 25 shows before then.

    At the moment I have to go in for them and save the permalink each time a new show is added so it doesn’t return a 404 before they can even just visit the url, let alone losing the convince of the “preview” button. It’s some major delay for them each time a show is published waiting for me to respond to their request. They are not quite savvy enough to be trained to save the permalink themselves. They’ve expressed their frustration with this process and I’ve assured them that I’m looking into it as fast as I can.

    I’m with Jan – where can I get a previous version of the pro plugin please.

    #1006196
    Brendyn Montgomery
    Participant

    I meant to say, I’d be happy to test out code fixes in order to have this working – I do have a staging site on the same environment that I can play with if that helps.

    #1006198
    Brendyn Montgomery
    Participant

    Found the download dropdown in my downloads and downgraded to 3.11 and that has resolved the issue.

    Should I downgrade events calendar main plugin to 3.11 or will I get away with leaving that as is on 3.12?

    #1006330
    Jan
    Participant

    The bug is in
    events-calendar-pro/src/Tribe/Recurrence_Permalinks.php

    I have searched for files that would make sense and found this file.
    I overwrite it with the version of Event Calendar Pro 3.11
    It works again.

    There had been only a couple of changes.

    I will sniff around a bit to maybe also can call you the line.

    #1006336
    Jan
    Participant

    It’s quite easy.

    You have to check first if this Permalinks should be rewritten:

    if ( ! $this->should_filter_permalink( $post, $sample ) ) {
    			return $post_link;
    		}

    before delete some URL arguments

    // URL Arguments on home_url() pre-check
    		$url_query = @parse_url( $post_link, PHP_URL_QUERY );
    		$url_args = wp_parse_args( $url_query, array() );
    		$permalink_structure = get_option( 'permalink_structure' );
    
    		// Remove the "args"
    		if ( ! empty( $url_query ) && '' !== $permalink_structure ) {
    			$post_link = str_replace( '?' . $url_query, '', $post_link );
    		}

    not the other way round.

    So in ‘events-calendar-pro/src/Tribe/Recurrence_Permalinks.php’
    Move lines 19 – 21 before lines 9 – 17

    This solves the problem. This is not tested extensively – put it just make sense.

    So – no I want to find out why this is executed on my post type.
    Why even run code on other post types than your cpt.

    The function ‘should_filter_permalink’ would check that – if it wasn’t to low in the ‘filter_recurring_event_permalinks’ – but why not check that sooner?

    Please – this is a easy fix and don’t seem like a thing that has to be tested extensively.

    Bring this in the new release.

    #1006337
    Jan
    Participant

    So this

    // URL Arguments on home_url() pre-check
    		$url_query = @parse_url( $post_link, PHP_URL_QUERY );
    		$url_args = wp_parse_args( $url_query, array() );
    		$permalink_structure = get_option( 'permalink_structure' );
    
    		// Remove the "args"
    		if ( ! empty( $url_query ) && '' !== $permalink_structure ) {
    			$post_link = str_replace( '?' . $url_query, '', $post_link );
    		}
    
    		if ( ! $this->should_filter_permalink( $post, $sample ) ) {
    			return $post_link;
    		}
    

    To

    
    // Check if permalinks should be filtered first
    if ( ! $this->should_filter_permalink( $post, $sample ) ) {
    			return $post_link;
    		}
    // URL Arguments on home_url() pre-check
    		$url_query = @parse_url( $post_link, PHP_URL_QUERY );
    		$url_args = wp_parse_args( $url_query, array() );
    		$permalink_structure = get_option( 'permalink_structure' );
    
    		// Remove the "args"
    		if ( ! empty( $url_query ) && '' !== $permalink_structure ) {
    			$post_link = str_replace( '?' . $url_query, '', $post_link );
    		}
    
    #1006370
    Christina Black
    Participant

    Thanks for all the hard work Jan!

    Critical bug for my client also. I have the PRO version disabled and they cannot add recurring events. Hearing complaints every day –

    When I first reported this – was told it was a theme issue. Disappointing response from Modern Tribe.

    Christina

    #1006493
    Nico
    Member

    Hi there,

    First of all thanks for helping each other out 🙂 and sorry again for the inconvenience this might cause to you or your clients.


    @avocadesign
    – great to hear that downgrading fixed this for you. I know it’s not the ideal solution at all, but until this is fixed it’s a valid option. And yes, you should downgrade The Events Calendar ‘core’ version as well.

    @ Jan – you rocked with that solution and thanks so much for sharing it here. I will make sure to log this into the associated bug report. I also bumped the priority on this one as this affecting more people than we assumed in first place. Surely a fix for this will be included in the upcoming release – not in the maintenance as it’s already in QA phase.

    @ Christina – sorry to hear about that. Reviewing your previous thread I see there’s no reference to the ‘preview’ feature failing, but more of a front-end links messing up. Sorry for the miss understanding there anyway.

    Also if anyone needs to access 3.11 version but -like Jan- this option is not available in the downloads page just let me know and I’ll generate a new license key for you that includes them.

    Please let me know if there’s anything else I can help you with, and thanks once again for helping each other here,
    Have a great weekend,
    Nico

    #1006715
    Jan
    Participant

    @nico

    Please try to get the fix in the maintenance release.

    The fix is easy and quite clear – once you look at it.

    And the bug suppose to have confusing effects.
    I imagine that all people who have any kind of custom post type activated have to have that bug. But many won’t notice that it is caused by Event Calendar Pro.
    I am a quite skilled programmer and it toke me about four hours to understand it’s Event Calendar Pro who mess it up.
    People without programming skills won’t understand where the bug comes from. That sucks.

    This is a bug that not only messes your plugin up, but a couple of other places :/

Viewing 15 posts - 1 through 15 (of 19 total)
  • The topic ‘Issue with "preview" button when events cal pro is activated’ is closed to new replies.