404 Error for Single Event

Home Forums Calendar Products Events Calendar PRO 404 Error for Single Event

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #1060518
    Greg
    Participant

    Everything was working just fine. However I’ve upgraded to Pro and since then, the single events generate a 404 error. I’ve tried re-doing and changing permalink. No dice. Everything else works fine.

    #1060714
    Hunter
    Moderator

    Greg,

    Thanks for posting to the support forums 🙂

    Do you have an actual page created under “Pages” titled “Events”? If so, go ahead and delete it. Flush the permalinks again and see if the 404 is still occurring. Next, I would check this article in relation to fixing 404 errors.

    Let me know if either does the trick and if not, we’ll continue troubleshooting. Thanks for choosing PRO!

    #1060743
    Greg
    Participant

    I found the problem is with your he Events Calendar: Advance Mini Calendar Widget plugin. When this is active I get the 404. When deactivated it works fine. However I do need that because I need the widget calendar to display a specific month by default

    #1062038
    Hunter
    Moderator

    Hey Greg,

    Sorry to hear you’re still having troubles. Would you mind sharing your System Information with me as a private reply?

    Thanks for your patience and have a good rest of your day/evening!

    #1062085
    Greg
    Participant

    This reply is private.

    #1062553
    Hunter
    Moderator

    Hey Greg,

    Thanks for getting back to me with your System Information. I don’t see anything that jumps out in the info. Take a look at our Testing for conflicts article. My guess is you’re experiencing a theme and/or plugin conflict.

    Let me know if that helps resolve your issue. Thanks for working with me on this and have a good rest of your day!

    #1062783
    Greg
    Participant

    HI Hunter. The error is occurring as a result of my customized theme. Switching to the default theme resolves. Disabling all the plugins does not resolve.

    – any clues on where I should look?

    • This reply was modified 8 years, 3 months ago by Greg.
    #1062796
    Greg
    Participant

    The issue is being caused by this code here in my functions.php . I’m using this code because I need to set the default date for the calendar. If I remove this code, the 404 error is resolved.

    function tribe_set_default_date () {
    if ( !is_single() && empty( $_REQUEST[‘tribe-bar-date’] ) ) {
    $_REQUEST[‘tribe-bar-date’] = ‘2016-07-01’;
    }
    }
    add_action( ‘parse_query’, ‘tribe_set_default_date’ );

    #1063436
    Hunter
    Moderator

    Welcome back Greg,

    I just tested the code on my local test environment and it seemed to work fine for me with the default Twentysixteen theme. Unfortunately I wouldn’t know where to begin with your theme conflict as I don’t have the source code and theme customizations extend beyond the scope of support we are able to offer.

    I would recommend reaching out to your theme author and see if they can provide more assistance. Thanks so much for understanding and best of luck resolving the issue!

    #1063439
    Greg
    Participant

    Well the single line of offending code is: $_REQUEST[‘tribe-bar-date’] = ‘2016-07-01’;

    I’m not sure how we debug this since this is code suggested by your knowledge-base and it is conflicting with your own code!

    What I’m trying to achieve with this is: for the ‘Date view (which isn’t the single page) I need it to show month view at that month since this is when the first events show up. However for some reason it is affecting the single event page (I assume it is single? Not sure how you are coding this).

    Bottom line: How do I ensure that the main events page which is in month view can show the month I want without triggering the 404 for the ‘single’ event view?

    #1064161
    Brook
    Participant

    Howdy Greg,

    Thanks for your thorough debugging thus far. I wrote that snippet you’re using, and to be frank it was quite hacky. I’m not exactly sure why it is 404ing for you and not everyone else, but I also know it could be improved and less prone to errors.

    I just rewrote the snippet:

    https://gist.github.com/elimn/d034dfddb9be206d9cc1

    Could you try replacing the entire snippet with the new one above? If you only want it to apply to month view, note that you can now comment out the tribe_is_list_view() line and uncomment the tribe_is_month() one. Either way you probably wish to uncomment the tribe_is_month() line.

    My apologies for our delayed response. Hunter was waiting all day for me to have time to rewrite the snippet.

    Does that new one work better?

    Cheers!
    – Brook

    #1064165
    Brook
    Participant

    I wanted to double check one thing, are you using this for Month view or the Minical widget?

    #1064168
    Greg
    Participant

    Hi Brook, did you test the code you suggested? It doesn’t compile and gives me the classic WP white screen of death.

    I’m using month view. Not sure what the Minical widget actually is.

    #1064561
    Brook
    Participant

    Howdy Greg,

    Thanks for getting back. Yeah the code has been tested extensively by a couple people. I wonder if you copied the opening <?php tag from the code? You typically only need one of those tags in your functions.php. It’s easiest to replace the opening <?php tag from the top of your functions.php with this entire snippet, since the snippet includes the <?php tag at the top.

    I found the problem is with your he Events Calendar: Advance Mini Calendar Widget plugin. When this is active I get the 404. When deactivated it works fine. However I do need that because I need the widget calendar to display a specific month by default

    You had mentioned the Mini Calendar widget earlier, that’s why I was asking about it. This snippet is designed to change the date for Month View, not the widget. Since it was untested with the widget I just wanted to double check with you.

    After following the advice above does the whitescreen go away? If not, could you share a copy of your entire functions.php file?

    Cheers!
    – Brook

    #1064715
    Greg
    Participant

    *sigh* yes of course I understand the php opener. I switched your code to ‘raw’ view and tried it again. Same problem. I guess there is some issue which is why the original line

    $_REQUEST[‘tribe-bar-date’] = ‘2016-07-01’;

    crashed the site.

Viewing 15 posts - 1 through 15 (of 27 total)
  • The topic ‘404 Error for Single Event’ is closed to new replies.