Home › Forums › Calendar Products › Events Calendar PRO › Plug-in causing Category bug
- This topic has 12 replies, 3 voices, and was last updated 8 years, 9 months ago by
Cliff.
-
AuthorPosts
-
August 3, 2017 at 11:59 am #1330308
Angela
ParticipantThe 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.
August 4, 2017 at 8:09 pm #1331094Cliff
MemberHi, 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?
August 5, 2017 at 11:28 am #1331271Angela
ParticipantSure!
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.
August 7, 2017 at 10:10 pm #1331927Cliff
MemberHere’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/
August 8, 2017 at 10:41 am #1332335Angela
ParticipantI 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.
August 8, 2017 at 11:07 am #1332351Cliff
MemberOkay, thank you.
If you switch to Twenty Seventeen theme, deactivate all other plugins, and then re-save Permalinks settings… then does it work?
August 8, 2017 at 7:31 pm #1332547Angela
ParticipantNope. 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.
August 8, 2017 at 9:16 pm #1332590Cliff
MemberHere’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.
August 9, 2017 at 5:33 pm #1333197Angela
ParticipantHi 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!
August 10, 2017 at 2:16 pm #1333746Cliff
MemberAngela, 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.
August 23, 2017 at 3:09 pm #1339414Angela
ParticipantHi 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!
August 23, 2017 at 8:53 pm #1339494Cliff
MemberI’m glad you were able to resolve this. Thanks for your effort and for the update!
-
AuthorPosts
- The topic ‘Plug-in causing Category bug’ is closed to new replies.
