Plug-in causing Category bug

Home Forums Calendar Products Events Calendar PRO Plug-in causing Category bug

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1330308
    Angela
    Participant

    The Events Calendar PRO plugin is affecting the page templates for Categories archive pages. The initial page loads just fine, but any page >1 is loading the tribe-events template instead of the categories post template.

    #1331094
    Cliff
    Member

    Hi, Angela. Sorry you’re experiencing this.

    Would you be able to share an annotated screenshot, screen capture video, and/or relevant URLs to clarify exactly what’s happening here?

    #1331271
    Angela
    Participant

    Sure!

    If you go to http://www.slugmag.com/comics you’ll see the normal archives layout using our theme’s category.php file. However, if you scroll to the bottom and click the ‘Next Page’ button (or go to http://www.slugmag.com/comics/page/2/) then you’ll see that the category.php file template is not loaded. Instead, the Events Calendar month.php template is used. All categories on our site are affected by this. The only way to fix it right now is to deactivate the Events Calendar PRO plugin.

    #1331927
    Cliff
    Member

    Here’s a video comparing my test site with your site: https://cl.ly/0C0Z3R0N0Y3C

    One thing I’d look into is how/why you don’t have the word “category” in your URL.

    Please install the Rewrite Rules Inspector plugin (third-party, not guaranteed or supported by us) and send me a screenshot of its analysis of http://www.slugmag.com/comics and then a 2nd one of http://www.slugmag.com/comics/page/2/

    #1332335
    Angela
    Participant

    I wasn’t able to get the video to work.

    Here is the screenshot of our Permalinks setting, and the output of the Rewrite Rules Inspector for the URLs you requested. I pulled all of the screenshots from our staging site, but it is configured the same as our production site.

    #1332351
    Cliff
    Member

    Okay, thank you.

    If you switch to Twenty Seventeen theme, deactivate all other plugins, and then re-save Permalinks settings… then does it work?

    #1332547
    Angela
    Participant

    Nope. With the Twenty Seventeen theme activated, all plugins deactivated (except for Events Calendar PRO), and the permalinks re-saved there’s another weird redirect happening. Now the http://staging.slugmag.com/comics/page/2 redirects completely to http://staging.slugmag.com/lifestyle/festival-coverage/page-one-a-year-inside-the-new-york-times/2/

    I’ve attached the output of the Rewrite Rules Inspector after the changes above were made.

    #1332590
    Cliff
    Member

    Here’s another video of what I’m experiencing on my test site: https://cl.ly/3a3s150F3Q1N

    I think you need to look into why you don’t have “category” in the “Source” column of the Rewrite Rules Analyzer results.

    Please let me know what you find out.

    #1333197
    Angela
    Participant

    Hi Cliff,

    I decided to go a different route with debugging and found a lot of good info.

    I printed the stack trace for both http://staging.slugmag.com/comics and http://staging.slugmag.com/comics/page/2/ with TEC PRO plugin activated then deactivate. I’ve attached the printout for the /page/2/ stack trace with TEC PRO turned on. I noticed that the page.php theme template was running, and TEC came into play by hooking into the “the_content” filter.

    But I still wasn’t sure why the page.php template was being called instead of category.php, so I dug deeper. The core file wp/wp-includes/template-loader.php applies the ‘template_include’ filter, which was changing category.php to page.php (with TEC PRO activated). For some reason, the function that TEC plugin hooks into that filter is mutating the template file when it shouldn’t be.

    I took a look at wp/wp-content/plugins/the-events-calendar/src/Tribe/Template.php that has a function that hooks into ‘template_include’. The function runs the ‘tribe_tec_template_chooser’ action, and then checks to see if the wp_query is a tribe events query; if not, the function returns the template string. It seems like the function isn’t working as expected since it’s mutating the template string for our categories archives.

    I’ve added a few lines of code to the template-loader.php file on our website so that our categories archives function as expected, but I’m obviously still hoping for a fix since the template-loader.php is a core file and upgrading our WordPress instance will re-introduce the problem if the plugin hasn’t fixed it yet.

    Thanks!

    #1333746
    Cliff
    Member

    Angela, thanks so much for your effort and detailed report. I had one of our developers take a look and confirmed what you said about tribe_tec_template_chooser action, which checks, like you said, if the query is an event query, here: https://github.com/moderntribe/the-events-calendar/blob/4.5.10/src/Tribe/Templates.php#L98

    Especially since I wasn’t able to replicate the issue, we’re wondering if you have any custom code in place to have regular WordPress Posts able to be assigned Event Categories (a customization we’ve seen some people implement before)

    I know you previously said on August 8 that you deactivated all non-Modern Tribe plugins and switched to Twenty Seventeen theme… that should have also removed any custom code you might have implemented, but maybe not somehow… did you clear your browser cache and your server cache as well?

    Please let me know what you find out.

    #1339414
    Angela
    Participant

    Hi Cliff,

    Thanks so much for all of your help with this issue. There was a plugin installed on our website called “Category pagination fix” by “rahnas” that was the real cause of this problem. I reverted the changes I made to the template-loader.php file and deactivated the plugin I mentioned, and our categories pagination is working just fine.

    Thanks again!

    #1339494
    Cliff
    Member

    I’m glad you were able to resolve this. Thanks for your effort and for the update!

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Plug-in causing Category bug’ is closed to new replies.