• Resolved nancy.hildebrandt

    (@nancyhildebrandt)


    Using a link checker on a small site with 24 events total, I’m seeing 404 errors for 565 links on 16,004 pages, and they’re all \related to various TEC archive pages, with some bizarre behavior. Here’s an example. Go to this page:

    https://linncountyswa.com/events/list/page/3/?eventDisplay=past

    To the left of the Today button, click the Left Arrow, which takes you to the previous set of past events–it’s got ‘/page/4/’ in the URL. It displays some events, right?
    Now refresh the page in your browser. Now you get a 404 error. But it’s the identical link.

    Another example: Go to https://linncountyswa.com/events/list/page/3/?tribe-bar-date=2021-08-15 . Click the right arrow (Next events) to get to page/4/, then reload the browser page.

    Installation:
    TEC Version 6.0.6.2. I had updated the database after installing.
    The Events Calendar: Category Colors: v 7.1.1
    WP v 6.1.1
    PHP v 7.4.33
    Beaver Builder Theme 1.7.12.1 + child theme

    Troubleshooting steps, with no success:
    After each attempt I purged the hosting server’s dynamic cache (SIteground) and shift-reloaded the browser page.
    1. Flushed the permalinks.
    2. Deactivated all plugins except TEC.
    3. Switched to generic WP theme.
    4. Deleted all transients.
    5. Bulk-resaved all the events. (There are only 24)
    6. Pasted the code from https://gist.github.com/elimn/d3483854e8e9399e449e into my child theme’s functions.php file in case that helps you troubleshoot.

    What SEEMED like it must be the problem, but…
    I found some old code in my child theme that I’d added a year and a half ago to circumvent a Beaver Builder bug in one of their modules that was not displaying a list of events properly. Surely, I thought, that must be the problem. But removing the code didn’t have any effect on this issue (and the code is permanently removed now). Here’s the code snippet though–perhaps something is still lurking in the events that was caused by this code?

    // Fix for Events Calendar showing past events in BB Posts module
    // Requires adding custom-posts ID to module
    /* function get_events_meta_query( $show_events = [] ) {
    	$local_time        = current_datetime();
    	$current_timestamp = $local_time->getTimestamp() + $local_time->getOffset();
    	$today             = gmdate( 'Y-m-d 00:00:00', $current_timestamp );
    	$current_time      = gmdate( 'Y-m-d H:i:s', $current_timestamp );
    	$queries 		   = [];
    	foreach ( $show_events as $event ) :
    		if ( 'today' === $event ) {
    			$queries[] = array(
    				'relation' => 'AND',
    				array(
    					'key'     => '_EventStartDate',
    					'compare' => '<=',
    					'value'   => $today,
    					'type'    => 'DATE',
    				),
    				array(
    					'key'     => '_EventEndDate',
    					'compare' => '>=',
    					'value'   => $today,
    					'type'    => 'DATE',
    				),
    			);
    		} elseif ( 'past' === $event ) {
    			$queries[] = array(
    				'key'     => '_EventEndDate',
    				'compare' => '<',
    				'value'   => $current_time,
    				'type'    => 'DATETIME',
    			);
    		} elseif ( 'future' === $event ) {
    			$queries[] = array(
    				'key'     => '_EventEndDate',
    				'compare' => '>',
    				'value'   => $current_time,
    				'type'    => 'DATETIME',
    			);
    		}
    	endforeach;
        $meta_query = array();
        if ( count( $show_events ) > 1 ) {
    		$meta_query['relation'] = 'OR';	
        }
    	foreach( $queries as $query ) {
    		$meta_query[] = $query;
    	}
     	return $meta_query;
    }
    add_filter( 'fl_builder_loop_query_args', function( $args ) {
        if ( 'custom-posts' === $args['settings']->id ) {
          $args['meta_query'] = get_events_meta_query( array( 'today', 'future' ) );
        }
        return $args;
    } );
    */

    There is no Beaver Themer layout controlling the archive area of the page that displays events, nor

    Thanks for whatever ideas you might have.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Abz

    (@abzlevelup)

    Hi @nancyhildebrandt, appreciate your patience here and thanks for creating another topic here.

    I reproduced the issue here, and you’re unto something here. This seems to only trigger on the last page.

    I already reached out to our team and I’d get back to you whenever I hear from them.

    Hang in there,
    Abz

    Thread Starter nancy.hildebrandt

    (@nancyhildebrandt)

    Hi Abz, Thank you, I appreciate YOUR patience in helping to solve this mystery. You’re right, it seems only to trigger on the last page of a list of events, going both backwards and (n the second example) forwards.

    I’d be happy to give you an admin login link if there’s any secure way to get it to you. Meanwhile, let me know if you need any other information. That troubleshooting code that I mentioned is still in the functions.php file if that helps provide any information.

    Plugin Support Abz

    (@abzlevelup)

    Hi @nancyhildebrandt, no worries. Please do not share any credentials, this is for us to follow the WordPress Forum Guidelines.

    Yes, that should be the case. 🤔

    Could you provide me the custom snippet on your functions.php instead? This might have been causing some issues and I’d like to check it as well.

    Looking forward to hearing from you.

    Thread Starter nancy.hildebrandt

    (@nancyhildebrandt)

    Hi Abz, The custom snippet is the one that appears in my initial post up above, commented “// Fix for Events Calendar showing past events in BB Posts module”. As I mentioned, the entire snippet is now commented out but it didn’t change the 404 behavior, but perhaps it affected the database entries in some way so it is still causing a problem even after the code was removed? I agree that code snippet seems very suspicious.

    Plugin Support Abz

    (@abzlevelup)

    Hi @nancyhildebrandt, yikes, I thought there was another custom snippet that you’re referring to. Apologies for the confusion.

    This could also be a redirect issue. Are you using a third-party plugin for redirection? Or if you have .htaccess set up for it?

    Thread Starter nancy.hildebrandt

    (@nancyhildebrandt)

    I can’t find any evidence that the site has redirects. The .htaccess file has no redirects, there is no redirect plugin, and I did try deactivating all the plugins except TEC and it didn’t change the broken links.

    But if you’re suspecting that something idiosyncratic to this site is causing the issue, and I still wonder if that custom code I had in functions.php messed up something in the database, I could try an experiment where I delete the oldest event and recreate it and see if that solves any of the past event 404 errors that we see on the last page of past events. Do you think there’s a chance that could work? If recreating one event fixes a few broken links, well then there are only 25 events, I could just recreate them all, problem solved, maybe?

    Plugin Support Abz

    (@abzlevelup)

    Hi @nancyhildebrandt, yikes. Perhaps you’re in to something here, since we have no luck in recreating the issue on our end even using the custom snippet here.

    It would be good if you could try to debug it more on your end as to which you mentioned here. If it still persists perhaps manually updating and recreating it as a last resort.

    As always, to be safe, we’d recommend conducting tests and updates on a Staging Server. Also, please keep a working backup of your website.

    Appreciate your patience so far here, Nancy and thanks for working with me on this. Please do keep me posted.

    Best,
    Abz

    Plugin Support Darian

    (@d0153)

    Hi @nancyhildebrandt

    We haven’t heard from you in a while. Were you able to resolve the issue?

    Let me know if you have further questions or concerns.

    Plugin Support Darian

    (@d0153)

    Hi @nancyhildebrandt

    This thread has been inactive for a while, so we’ll go ahead and mark it Resolved. Please open a new thread if any other questions arise, and we’d be happy to help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘404 error with some past event archive pages’ is closed to new replies.