atomicdust

Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • in reply to: Some Recurring Events Don't Save Properly #1597079
    atomicdust
    Participant

    I wanted to add one more bit of detail to this ticket. I noticed that even after deleting the recurring events from the above screenshot, moving on and making other changes, some other events disappeared from the front-end and stopped working correctly in the back-end.

    If you look at the attached screenshots, there are 3 at the bottom that no longer have “Show Details.” These events had saved fine several times this morning, so the problem seems to be somewhat random. I just happened to remove some other meta data from this event, saved, and they stopped working.

    Thanks,

    Tim

    atomicdust
    Participant

    I don’t think my screenshot attached properly to the original post.

    atomicdust
    Participant

    Thanks for the information. I’ll check in at a later time.

    atomicdust
    Participant

    Andras,

    That is less than ideal but would be an ok temporary solution. It’s better than switching the whole site to one timezone for us. Do you know if there are plans to fix this in the future?

    Thanks,

    Tim

    atomicdust
    Participant

    It seems my above suggested solution really only works for the single event page, not upcoming event queries. When upcoming events are queried the database is checked for _EventEndDate, which won’t work if the server is set to a different timezone than the event.

    Why not convert current time to UTC and do all queries based on _EventEndDateUTC? I am sure this is not as simple as I’m suggesting, but seems like the only way to create true local timezone support.

    It seems that currently the only working solution is to use the same timezone sitewide rather than displaying localized timezone, which is less than ideal for the visitor. Please let me know if you have any other suggestions.

    atomicdust
    Participant

    After digging into this more, it seems as though the tribe_is_past_event function just doesn’t check an event’s timezone when determining if it has passed. It only looks at the gmt_offset option.

    Here is an example of what could theoretically fix the problem. I’m not sure what the implications of something like this would be on other functions of the site or with different plugin configurations, but it seems like a good start. Any ideas on how something like this could be implemented in a way that doesn’t involve modifying the plugin myself?

    	/**
    	 * Detect if an Event is Past
    	 *
    	 * Returns true if the current time is past the event end time
    	 *
    	 * @param null $event
    	 *
    	 * @return bool
    	 */
    	function tribe_is_past_event( $event = null ) {
    
    		if ( is_null( $event ) ) {
    			global $post;
    			$event = $post;
    		}
    		
    		$timezone = Tribe__Events__Timezones::get_event_timezone_string($event->ID);
    		
    		if ($timezone) {
    			$time = new \DateTime('now', new DateTimeZone($timezone));
    			$timezoneOffset = intval(str_replace(':00', '', (string) $time->format('P')));
    		} else {
    			$timezoneOffset = get_option( 'gmt_offset' );
    		}
    		
    		// Check if event has passed
    		$gmt_offset = ( $timezoneOffset >= '0' ) ? ' +' . $timezoneOffset : ' ' . $timezoneOffset;
    		$gmt_offset = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset );
    
    				
    		if ( strtotime( tribe_get_end_date( $event, false, 'Y-m-d G:i' ) . $gmt_offset ) <= time() ) {			
    			return true;
    		}
    
    		return false;
    
    	}
    atomicdust
    Participant

    Thanks. One additional question — Because it’s a longstanding issue, has any recommended workaround ever been developed? Maybe something we can implement in our theme as a temporary solution?

    It is vital for us, because we promote specific categories of events to different pages, so visitors will end up on these URLs.

    atomicdust
    Participant

    Most tests have been done on desktop but I was able to reproduce the issue on an iPhone just now.

    The bug occurs when I click the Next button at this URL: http://192.168.1.10:8080/calendar/category/academics/list/

    This is a local dev URL but it does happen on our staging site as well.

    The month view for categories appears to work as expected.

    Also, just a couple additional clarifications: I did try switching my default views to match but still had the same issue. And it’s for all categories, not just academics.

    • This reply was modified 6 years, 7 months ago by atomicdust.
    atomicdust
    Participant

    Deactivating “The Events Calendar: Filter Bar” plugin fixes the problem.

    – Deactivated all other plugins besides Tribe plugins
    – Activated Twenty Seventeen
    – Problem persisted

    – Deactivated Filter Bar, the problem was fixed.

    The odd thing about this is it appears the Filter Bar is activated on your demo site.

    Version info:

    The Events Calendar 4.5.12.2
    PRO 4.4.17
    Filter Bar 4.5

    • This reply was modified 6 years, 7 months ago by atomicdust. Reason: version info
    atomicdust
    Participant

    http://192.168.1.10:8080/calendar/category/academics/list/?tribe_event_display=list&tribe_paged=3

    This link works if I go directly to it in a new tab. It’s the same link as the “Next” button, but clicking the actual button redirects me.

    I’m going to start deactivating plugins and reverting to the base theme to make sure that is not the cause.

    The other idea that came to mind is that I’m using 2 different modes for desktop and mobile.

    • This reply was modified 6 years, 7 months ago by atomicdust. Reason: The information previously posted was incorrect
    atomicdust
    Participant

    Our ‘Previous’ button matches yours. The previous button would take you to past events. That link is from our ‘Next Events’ button.

    The difference in the demo is that your “Next” button doesn’t show, I assume because there are no future events beyond page 1 in that category? But our categories do have multiple pages of future events.

    Our previous and next events are generated using the default list/nav.php template. We have customized list.php to change the HTML, but it still just calls the default list/content.php from the plugin, which then calls list/nav.php for the buttons.

    EDIT: Accidentally clicked ‘correct answer?’ but obviously this is not an answer.

    • This reply was modified 6 years, 7 months ago by atomicdust.
    • This reply was modified 6 years, 7 months ago by atomicdust.
    in reply to: Customize Imported Fields #1269394
    atomicdust
    Participant

    Would it be possible to have my license key voided and receive a refund? It won’t be useable to me in this fashion. Thanks.

    in reply to: Customize Imported Fields #1269393
    atomicdust
    Participant

    That helps, thanks.

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