Natasha

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: Recurring events 404 with update #1370241
    Natasha
    Participant

    Yay! It’s working now!

    Is there a reason the Pro plugin didn’t show an update through automatic updates? Why did I have to do a manual download and update?

    in reply to: Recurring events 404 with update #1366177
    Natasha
    Participant

    Hi Patricia,

    I went through the process described in the link you sent, and still experienced the 404 error on the recurring events single (and /all/) page.

    We are not using a CDN.

    Natasha
    Participant

    Thank you Geoff and Nico. Since my workarounds seemed to have fixed the issue, it’s hard for me to say whether the update has fixed it entirely. I’ll keep an eye on it.

    Geoff, as far as that remove_action( 'tribe_events_date_display', array( 'Tribe__Events__Pro__Recurrence__Meta', 'loadRecurrenceData' ) ); code, is there anyway to have that affect the Community/Add form? We’ve determined that hiding recurring from basic users is a good idea for us.

    Natasha
    Participant

    I got it to work, I think it was just taking a minute for the cron to run.

    But, shucks, that solution won’t work either. When the post date is changed to one in the future, it ends up as a ‘Scheduled’ post and not visible on the front end.

    Natasha
    Participant

    Hi Geoff,

    We’ve added a function on ‘save_post’ that is working for making ‘post_date’ match ‘_EventStartDate’ initial event, but it’s hanging when trying to update the recurring events and not updating their post_dates.

    /**
     * Upon save, make sure the post_date matches event_date
     * @param  integer $post_ID
     */
    add_action( 'save_post', 'sebcal_post_date_match_event_date' );
    function sebcal_post_date_match_event_date( $post_ID ){
    
    	//if its not a tribe_event type, get out.
    	if ( Tribe__Events__Main::POSTTYPE != get_post_type( $post_ID ) ) return;
    
    	//get event_date
    	$event_date = get_post_meta( $post_ID, '_EventStartDate', true );
    	$event_dateUTC = get_post_meta( $post_ID, '_EventStartDateUTC', true );
    
    	//set post_date to match event date
    	$newDate = array(
    		'ID' => $post_ID,
    		'post_date' => $event_date, // [ Y-m-d H:i:s ]
    		'post_date_gmt' => $event_dateUTC // [ Y-m-d H:i:s ]
    	);
    
    	//unhook this function, so we don't get infinite loop on save
    	remove_action( 'save_post', 'sebcal_post_date_match_event_date' );
    
    	//run the update
    	$result = wp_update_post( $newDate, true );
    
    	//re-hook this function
    	add_action( 'save_post', 'sebcal_post_date_match_event_date' );
    }
    Natasha
    Participant

    Hi Geoff,

    Ben Klocek is my go-to guy for this. I’ve been forwarding him all your emails. Fine to keep going through me. He will be the one to set the hook, so to speak.

    😉

    Natasha
    Participant

    Hi Geoff,

    Thanks for following up. For your questions:

    1. No functions were carried over when I switched to Twenty Seventeen theme. I had disabled each function to test in our custom theme, but wanted to be sure, so tested with 2017.
    2. In the local/testing environment, the caching plugin is disabled.
    3. Yes, the events in question were re-saved.

    As for your second post with potential causes.

    1. We are on an apache server with BlueHost.
    2. I suspect this might be the cause of our issue.

    So to clarify your temporary solution: Go through each event in the series and edit them individually to change the post_date to match the event_date?

    I’ll see what we can do. FWIW, it would be good to have a hook or function that allows us to turn off the recurring feature until this is fixed. We’re using Community Events, and with recurring events, that’s a whole lot of admin work to manage if our community has access.

    Thanks for digging into this.

    • This reply was modified 6 years, 12 months ago by Natasha.
    Natasha
    Participant

    This reply is private.

    Natasha
    Participant

    Thank you Geoff.

    I’m cc’ing Ben Klocek who is the genius behind all of this. He can set you up. I just pay the bills. 😉

    Natasha
    Participant

    This reply is private.

    • This reply was modified 7 years ago by Natasha. Reason: Adding resaving event to the list of debugging actions
    Natasha
    Participant

    Looks like my meta query was overriding the meta query where the key to use was being set. I’ve added

    'relation' => 'AND',
    			array(
    					'key' => '_EventStartDateUTC'
    			),

    to the top of my meta query and it looks like we’re back in action.

Viewing 11 posts - 1 through 11 (of 11 total)